exif_read {exiftoolr} | R Documentation |
Read EXIF and other metadata from files
Description
Reads EXIF and other metadata into a data.frame
by calling Phil
Harvey's ExifTool command-line application.
Usage
exif_read(
path,
tags = NULL,
recursive = FALSE,
args = NULL,
quiet = TRUE,
pipeline = c("json", "csv")
)
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 |
|
args |
Additional arguments. |
quiet |
Use |
pipeline |
One of |
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, DJI, FLIR, FujiFilm, GE, GoPro, 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.
Value
A data frame of class "exiftoolr"
with one row per file
processed. The first column, named "SourceFile"
gives the name(s)
of the processed files. Subsequent columns contain info from the tags
read from those files.
Note that binary tags such as thumbnails are loaded as
base64-encoded strings that
start with "base64:"
. Although these are truncated in the printed
representation of the data.frame
returned by the function, they
are left unaltered in the data.frame
itself.
References
Examples
## Not run:
files <- dir(system.file(package = "exiftoolr", "images"),
pattern = "LaSals|Lizard", full.names = TRUE)
exif_read(files)
exif_read(files, tags = c("filename", "imagesize"))
## Use pipeline="csv" for images needing explicit specification
## and proper handling of a non-default character sets
img_file <- system.file(package = "exiftoolr", "images", "QS_Hongg.jpg")
args <- c("-charset", "exiftool=cp1250")
res <- exif_read(img_file, args = args, pipeline = "csv")
res[["City"]] ## "Zurich", with an umlaut over the "u"
## End(Not run)