| ct_get_hs | R Documentation |
Extracts hierarchical subject metadata from image files using ExifTool. Hierarchical subjects follow a parent|child structure (e.g., "Species|Vulture") and are commonly used for taxonomic or categorical image classification.
ct_get_hs(path, hs_delimitor = "|", into_tibble = FALSE)
path |
A character string specifying the full path to the image file. Must be a valid file path to an image with EXIF metadata support. |
hs_delimitor |
The character delimiting hierarchy levels in image metadata tags in field "HierarchicalSubject" |
into_tibble |
Logical. Parse hierarchical subjects into tibble. |
A character vector or tibble of unique hierarchical subjects if they exist,
otherwise NULL. Each element represents one hierarchical subject in
"parent|child" format.
ct_create_hs() to add hierarchical subjects
ct_remove_hs() to remove hierarchical subjects
ct_read_metadata() to read image metadata
## Not run:
# Path to example image
image_path <- file.path(system.file("img", package = "ct"), "large.jpeg")
# Retrieve hierarchical subjects (returns NULL if none exist)
hs <- ct_get_hs(path = image_path)
print(hs)
# After adding hierarchical subjects
ct_create_hs(path = image_path, value = c("Species" = "Vulture"))
ct_get_hs(path = image_path) # Returns: "Species|Vulture"
# Multiple hierarchical subjects
ct_create_hs(
path = image_path,
value = c("Species" = "Eagle", "Location" = "Mountains")
)
ct_get_hs(path = image_path) # Returns vector with both subjects
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.