scan_jpeg: Scan jpeg file for section locations

Description Usage Arguments Details Value Examples

View source: R/scan_jpeg.R

Description

A jpeg file is made up of a bunch of different sections Some of these sections contain image metadata and other sections contain the image data itself.

Usage

1
scan_jpeg(input, extract_first = NULL)

Arguments

input

A character path to a jpeg file or a seek-able connection object

extract_first

(Optional) If you only to extract a single section, you may provide the marker number, the section name, the section ID, or a function that will take a section and return TRUE for the section you want to extract. Only the first instance of a matching section is returned. If no sections match, NULL will be returned.

Details

This function will find the different sections located in the beginning of the file before the image data. It will identify the byte offset and length for each of these sections. Exif data can be included in one of theses sections, and if found, this data is parsed into the different key/value/format information.

Value

A list containing image metadata and tags if extract_first is NULL. Otherwise only the matching section is returned and NULL is returned if no matching sections are found

Examples

1
2
3
sample_file <- system.file("extdata", "Iguana_iguana_male_head.jpg", package="readexif")
scan_jpeg(sample_file)
as.data.frame(scan_jpeg(sample_file))

MrFlick/readexif documentation built on Dec. 17, 2021, 4:22 a.m.