Remove Specific or All HierarchicalSubject Values from Image Metadata
mm_remove_hs.Rd
The mm_remove_hs function removes a specific hierarchy from the
Hierarchical Subject
field in an image's metadata, or it removes the entire
field if no specific hierarchy is provided. It uses exiftool
to manipulate the metadata and ensure that only the desired changes are applied.
Arguments
- path
A character vector specifying the full path of the image file.
- hierarchy
A named character vector, e.g c("Species" = "Vulture") specifying the hierarchy to be removed. If NULL, the entire
Hierarchical Subject
field is removed.- intern
TRUE if output should be returned as a character vector.
- quiet
Suppress output of the command itself.
- ...
additional arguments to be passed to
system2()
Examples
# Image path
image_path <- file.path(system.file("img", package = "maimer"), "large.jpeg")
# Get Hierarchical Subject from the image
no_hs <- mm_get_hs(path = image_path)
mm_create_hs(image_path, c("A" = "AB"))
#> Warning: error in running command
#> [1]
mm_remove_hs(image_path, c("A" = "AB"))
#> [1] Hierarchy A|AB does not exist. No change applied to large.jpeg