edit_xmp | R Documentation |
get_xmp()
gets xmp metadata from a file.
set_xmp()
sets xmp metadata for a file.
get_xmp(filename, use_names = TRUE)
get_xmp_exiftool(filename, use_names = TRUE)
set_xmp(xmp, input, output = input)
set_xmp_exiftool(xmp, input, output = input)
filename |
Filename(s) to extract xmp metadata from. |
use_names |
If |
xmp |
An |
input |
Input filename. |
output |
Output filename. |
get_xmp()
will try to use the following helper functions in the following order:
get_xmp_exiftool()
which wraps exiftool
command-line tool
set_xmp()
will try to use the following helper functions in the following order:
set_xmp_exiftool()
which wraps exiftool
command-line tool
get_xmp()
returns a list of xmp()
objects.
set_xmp()
returns the (output) filename invisibly.
xmp()
for more information about xmp metadata objects.
supports_get_xmp()
, supports_set_xmp()
, and supports_exiftool()
to detect support for these features. For more info about xmp metadata see https://www.exiftool.org/TagNames/XMP.html.
x <- xmp(attribution_url = "https://example.com/attribution",
creator = "John Doe",
description = "An image caption",
date_created = Sys.Date(),
spdx_id = "CC-BY-4.0")
print(x)
print(x, mode = "google_images", xmp_only = TRUE)
print(x, mode = "creative_commons", xmp_only = TRUE)
if (supports_set_xmp() &&
supports_get_xmp() &&
capabilities("png") &&
requireNamespace("grid", quietly = TRUE)) {
f <- tempfile(fileext = ".png")
png(f)
grid::grid.text("This is an image!")
invisible(dev.off())
set_xmp(x, f)
print(get_xmp(f)[[1]])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.