### "trial" run. create a table with file names after renaming, but don't copy images.
# first, find sample image directory in package directory:
wd_images_raw <- system.file("pictures/raw_images", package = "camtrapR")
if (Sys.which("exiftool") != ""){ # only run this example if Exiftool is available
renaming.table <- imageRename(inDir = wd_images_raw,
# outDir = getwd(), # because copyImages = FALSE, outDir does not need to be defined
hasCameraSubfolders = FALSE,
copyImages = FALSE,
writecsv = FALSE
)
} else {
print("Exiftool is not available. Cannot test function")
}
# define image directories
# raw image location
wd_images_raw <- system.file("pictures/raw_images", package = "camtrapR")
# destination for renamed images
wd_images_raw_renamed <- paste(getwd(), "raw_images_renamed", sep = "/")
if (Sys.which("exiftool") != ""){ # only run this example if Exiftool is available
renaming.table2 <- imageRename(inDir = wd_images_raw,
outDir = wd_images_raw_renamed, # now, copyImages = TRUE, so we have to set outDir
hasCameraSubfolders = FALSE,
copyImages = TRUE,
writecsv = FALSE
)
}
list.files(wd_images_raw_renamed, recursive = TRUE)
Run the code above in your browser using DataLab