knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The readexif package is an R package that allows you to read Exif metadata from jpeg image files.
The existing exifr package can extract more detailed information and can translate more of the "raw" values found in the Exif data but it requires that you also install ExifTool as a system dependency. While readexif is not as full-featured, it does not require this separate program to be installed.
You can install the latest version of readexif from GitHub with:
remotes::install_github("MrFlick/readexif")
This package is currently a work-in-progress and is not yet available on CRAN.
The primary useful function for extracting data is exif_df
which can take a list of file names and will return a data.frame
containing the Exif tags for all those images.
library(readexif) sample_dir <- system.file("extdata", package="readexif") sample_files <- file.path(sample_dir, c("Iguana_iguana_male_head.jpg", "Red-headed_Rock_Agama.jpg")) transform(exif_df(sample_files), file=basename(file))
Another useful function is scan_jpeg
. This is the function will return the positions for each of the different sections in the jpeg file.
sample_file <- system.file("extdata", "Iguana_iguana_male_head.jpg", package="readexif") toc <- scan_jpeg(sample_file) toc toc[[6]] toc[[2]]$tags toc[[2]]$tags[[2]]
This package was created using the helpful information from the following resources
This package includes sample images from ianare/exif-samples. Some images originally were from Wikimedia Commons. Those images are
Note that these images were scaled down to reduce file size.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.