exifTagNames: Show Exif metadata tags and tag names from JPEG images

View source: R/exifTagNames.R

exifTagNamesR Documentation

Show Exif metadata tags and tag names from JPEG images

Description

The function will return sample metadata and tag names of Exif metadata of JPEG images. It uses the first JPEG image it finds in a subdirectory of the specified directory.

Usage

exifTagNames(inDir, 
  whichSubDir = 1,
  returnMetadata = FALSE,
  returnTagGroup = TRUE)

Arguments

inDir

character. Directory containing camera trap images sorted into station subdirectories (e.g. inDir/StationA/)

whichSubDir

integer. The number of the subdirectory of inDir in which to look for an image

returnMetadata

logical. Return actual metadata (TRUE) or metadata tag names only (FALSE)

returnTagGroup

logical. Return tag group along with tag names (e.g. EXIF, IPTC, XMP, MakerNotes)

Details

Many digital cameras record information such as ambient temperature or moon phase under maker-specific tag names in Exif metadata of JPEG images. In addition, many technical information are stored in Exif metadata. In order to extract those information from images and add them to the record tables created by the functions recordTable and recordTableIndividual, the tag names must be known so they can be passed to these functions via the additionalMetadataTags argument.

By default the function returns both metadata tag names and the metadata group they belong to (via argument returnTagGroup). This is helpful to unambiguously address specific metadata tags, because different groups can contain tags of identical names, which may cause problems executing the functions recordTable and recordTableIndividual. The format is "GROUP:tag", e.g. "EXIF:Flash".

Value

A character vector containing available metadata or metadata tag names (and groups).

Author(s)

Juergen Niedballa

References

Phil Harvey's ExifTool http://www.sno.phy.queensu.ca/~phil/exiftool/

See Also

recordTable

Examples

if (Sys.which("exiftool") != ""){        # only run this example if ExifTool is available
wd_images_ID <- system.file("pictures/sample_images", package = "camtrapRdeluxe")

# return tag names only
exifTagNames(inDir          = wd_images_ID,
             returnMetadata = FALSE)

# return tag names and metadata
exifTagNames(inDir          = wd_images_ID,
             returnMetadata = TRUE)
}

carlopacioni/camtrapRdeluxe documentation built on Nov. 29, 2023, 3:37 a.m.