Skip to contents

Downloads images based on their Flickr ID. Uses the flickr.photos.getSizes API method from the Flickr API to test whether you have permission to download an image. See https://www.flickr.com/services/api/flickr.photos.getSizes.html for more information on the API method. If permission is available the image is downloaded and saved as a .jpeg in a given save directory.

Usage

download_images(
  photo_id,
  save_dir = NULL,
  max_image_height = NULL,
  max_image_width = NULL,
  overwrite_file = FALSE,
  quiet = FALSE
)

Arguments

photo_id

numeric or character vector. id of photo to download, can be single id, list or column for photo_search outputs

save_dir

character. name of directory for photos to be saved in.

max_image_height

numeric. maximum number of pixels for images height

max_image_width

numeric. maximum number of pixels for images width

overwrite_file

logical. Whether to overwritten existing files. if TRUE, files will be overwritten and you will be warned in the output. Default is FALSE.

quiet

logical. If TRUE, suppress status messages (if any), and the progress bar.

Value

character. A vector of the images attempted to be downloaded and whether they were. If an image was not downloaded, information on why is provided. Images will be saved to save_dir.

Details

Please be aware that download times will vary depending on number of photographs, size of photographs, internet speed and other factors. Downloading a large amount of photographs may take some time.

When running the function you need an API key saved as photosearcher_key.sysdata in your working directory. If this is the first function you run you will be prompted to create and enter your API key. The API key will then be saved as photosearcher_key.sysdata in your working directory and is used for all function.

See also

Other Get data for known photograph: get_exif(), get_photoinfo()

Examples

if (FALSE) {
download_images(photo_id = 48704764812, save_dir = ".")

download_images(photo_id = 48704764812, max_image_height = 1200,
max_image_width = 1200, save_dir = ".") }