read_exif: Read EXIF data from files

Description Usage Arguments Details Value Examples

View source: R/read_exif.R

Description

Reads EXIF data into a data.frame by calling the ExifTool command-line application, written by Phil Harvey. Depending on number of images and command-line length requirements, the command may be called multiple times.

Usage

1
read_exif(path, tags = NULL, recursive = FALSE, args = NULL, quiet = TRUE)

Arguments

path

A vector of filenames

tags

A vector of tags to output. It is a good idea to specify this when reading large numbers of files, as it decreases the output overhead significantly. Spaces will be stripped in the output data frame. This parameter is not case-sensitive.

recursive

TRUE to pass the "-r" option to ExifTool

args

Additional arguments

quiet

Use FALSE to display diagnostic information

Details

From the ExifTool website: ExifTool is a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in a wide variety of files. ExifTool supports many different metadata formats including EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP and ID3, as well as the maker notes of many digital cameras by Canon, Casio, FLIR, FujiFilm, GE, HP, JVC/Victor, Kodak, Leaf, Minolta/Konica-Minolta, Motorola, Nikon, Nintendo, Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Phase One, Reconyx, Ricoh, Samsung, Sanyo, Sigma/Foveon and Sony. For more information, see the ExifTool website.

Note that binary tags such as thumbnails are loaded as base64-encoded strings that start with "base64:".

Value

A data frame (tibble) with columns SourceFile and one per tag read in each file. The number of rows may differ, particularly if recursive is set to TRUE, but in general will be one per file.

Examples

1
2
3
4
5
6
files <- list.files(path.package("exifr"), recursive=TRUE, pattern="*.jpg", full.names=TRUE)
exifinfo <- read_exif(files)
# is equivalent to
exifinfo <- read_exif(path.package("exifr"), recursive=TRUE)

read_exif(files, tags=c("filename", "imagesize"))

paleolimbot/exifr documentation built on March 25, 2021, 3:21 a.m.