forked from JoshOBrien/exiftoolr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexif_call.Rd
70 lines (60 loc) · 2.1 KB
/
exif_call.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/exif_read.R
\name{exif_call}
\alias{exif_call}
\alias{exif_version}
\title{Call ExifTool from R}
\usage{
exif_call(args = NULL, path = NULL, intern = FALSE, quiet = FALSE, ...)
exif_version(quiet = TRUE)
}
\arguments{
\item{args}{Character vector of arguments, each written in same
form as you would if writing them on the command line
(e.g. \code{"-n"} or \code{"-csv"})}
\item{path}{A character vector giving one or more file paths.}
\item{intern}{\code{TRUE} if output should be returned as a
character vector. Default value is \code{FALSE}.}
\item{quiet}{Use \code{FALSE} to display diagnostic
information. Default value is \code{FALSE}.}
\item{...}{Additional arguments to be passed to \code{system()}.}
}
\value{
The exit code (if \code{intern = FALSE}) or the standard
output as a character vector (if \code{intern = TRUE}).
}
\description{
Uses \code{system()} to run a basic call to \code{exiftool}.
}
\details{
For examples of the command-line calls to ExifTool (all
of which can be reproduced by calls to \code{exif_call}), see
\url{https://exiftool.org/examples.html}.
}
\examples{
\dontrun{
## Find local ExifTool version using exif_version() or exif_call()
exif_version()
exif_call(args = "-ver", intern = TRUE, quiet = quiet)
## Make temporary copies of a couple jpeg files
tmpdir <- file.path(tempdir(), "images")
file.copy(dir(system.file(package = "exiftoolr", "images"),
full.names = TRUE), tmpdir, recursive = TRUE)
files <- dir(tmpdir, full.names = TRUE)
## 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, intern = TRUE)
## 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)
unlink(files)
}
}