Populating image headers- Credit, contact information, copyright, usage terms, image descriptions, attribution url, metadata link, and georeferencing information were added to the exchangeable image file format (EXIF) header of each image using Phil Harvey’s ExifTool. The images were grouped by image type (core logs, photographs, and x-rays) into separate folders: 2023-307-FA_CoreLogs, 2023-307-FA_CorePhotos, and 2023-307-FA_CoreXRays. All information in the scripts were the same among all images, aside from the EXIF:ImageDescription, EXIF:DateTimeOriginal, EXIF:GPSLatitude and EXIF:GPSLongtitude information, as that information varies for each core. A separate script containing the core-specific header information was run on each image individually to populate those headers. The core logs and photographs are published as JPGs, whereas the core x-rays are published as TIFs. Therefore, all mentions of the file extension in the example scripts below used ".TIF" rather than ".JPG" for the x-ray images. Image header information was also populated for the files 2023-307-FA_Cores_GrainSizeDistributions.jpg and 2023-307-FA_GrainSize_TernaryPlot.jpg in 2023-307-FA_GrainSizeData.zip. However, since these image details grain-size data for all samples, the EXIF:GPSMapDatum, EXIF:GPSAreaInformation, and core-specific headers were not added.
First, the following command was run on all images in a folder to preserve filenames:
exiftool -P "-XMP:PreservedFileName<Filename" *.jpg
Second, the following command was run on all images in a folder to populate the first set of headers.
exiftool -IPTC:Credit="U.S. Geological Survey" -IPTC:Contact="gs-g-spcmsc_data_inquiries@usgs.gov" -EXIF:Copyright="Public Domain" -XMP:UsageTerms="Unless otherwise stated, all data, metadata and related materials are considered to satisfy the quality standards relative to the purpose for which the data were collected. Although these data and associated metadata have been reviewed for accuracy and completeness and approved for release by the U.S. Geological Survey (USGS), no warranty expressed or implied is made regarding the display or utility of the data for other purposes, nor on all computer systems, nor shall the act of distribution constitute any such warranty." -XMP:AttributionURL="
https://doi.org/10.5066/P13KRKA4" -XMP:Event="2023-307-FA" -EXIF:GPSAreaInformation="Location of core collection site, GPS coordinates are in NAD83" -XMP:ExternalMetadataLink="
https://www1.usgs.gov/pir/api/identifiers/USGS:4e67da86-b79a-4666-984b-5fb89ee580c8" -EXIF:GPSMapDatum="NAD83" *.jpg
Third, the following command was run on each image in the folder to populate the unique image headers for each core. This command called on a .csv file “23BIM03_CorePhotos_ExifHeaders.csv") containing the image file name, image description, core collection date, GPS latitude, and GPS longitude of each core.
exiftool -csv='23BIM03_CorePhotos_ExifHeaders.csv' *.jpg
Fourth, the following command run on all images in a folder to copy information into duplicate tags:
exiftool -P "-XMP-photoshop:Credit<IPTC:Credit" "-XMP-iptcCore:CreatorWorkEmail<IPTC:Contact" "-XMP-dc:Rights<EXIF:Copyright" "-XMP-dc:Description<EXIF:ImageDescription" "-XMP-exif:all<GPS:all" "-XMP-photoshop:DateCreated<EXIF:DateTimeOriginal" "-EXIF:GPSDateStamp<EXIF:DateTimeOriginal" -overwrite_original *.JPG
To extract the information from the image headers using ExifTool, run the following command after connecting to the unzipped folder containing the images:
exiftool a.jpg, where 'a' is replaced with the filename (example: 23BIM03-13_Stitched.jpg)