exif_call | R Documentation |
Uses system2()
to run a basic call to exiftool
.
exif_call(
args = NULL,
path = NULL,
stdout = TRUE,
quiet = FALSE,
...,
config_file = NULL,
common_args = NULL
)
exif_version(quiet = TRUE)
args |
Character vector of arguments, each written in same
form as you would if writing them on the command line
(e.g. |
path |
A character vector giving one or more file paths. |
stdout |
Where output to stdout should be sent. If
|
quiet |
Use |
... |
Additional arguments to be passed to |
config_file |
Path to a config file of the format expected by
Exiftool's command line |
common_args |
A character vector of arguments to be applied
to all executed commands when the Exiftool |
For examples of the command-line calls to ExifTool (all
of which can be reproduced by calls to exif_call
), see
https://exiftool.org/examples.html.
Under the hood, exif_call()
writes the options in
args
to a text file and then calls Exiftool, passing
that text file's contents to Exiftool via its -@
ARGFILE
option. -config
and -common_args
are
the two options that may not be used in such a -@
ARGFILE
, so we handle that option separately using
exif_call()
's config_file
argument.
The standard output as a character vector.
## Not run:
## Find local ExifTool version using exif_version() or exif_call()
exif_version()
exif_call(args = "-ver")
## Make temporary copies of a couple jpeg files
tmpdir <- tempdir()
src_files <- dir(system.file(package = "exiftoolr", "images"),
full.names = TRUE)
files <- file.path(tmpdir, basename(src_files))
file.copy(src_files, files)
## Both of the following extract the same tags:
exif_read(files, tags = c("filename", "imagesize"))
exif_call(args = c("-n", "-j", "-q", "-filename", "-imagesize"),
path = files)
## Set value of a new "Artist" field in photo's metadata
file1 <- files[1]
exif_read(file1, tags = "artist")
exif_call(path = file1, args = "-Artist=me")
exif_read(file1, tags = "artist")
## Remove all but a few essential fields
length(exif_read(file1))
exif_call(path = file1, args = "-all=")
length(exif_read(file1))
exif_read(file1)
## Clean up
unlink(files)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.