Metadata output guide
XMP sidecar vs. EXIF copy for photo GPS metadata
Choose a reversible sidecar or a separate metadata-bearing copy based on compatibility, downstream workflow and how strongly you need to preserve original image bytes.
Start with the non-negotiable
Neither path needs to overwrite an original. Preserve the selected photo bytes, re-hash them before export and put all derived artifacts in a new destination with a manifest.
A sidecar is a new small .xmp companion; the image is untouched.
A copy is a new image file whose metadata is changed; the source is untouched.
Useful across JPEG, HEIC, TIFF, PNG and other inventoried files when the next tool reads XMP.
Current TrackExif support is limited to JPEG, HEIC and TIFF-family files that ImageIO can write and re-read.
Remove or replace the sidecar to undo the association.
Keep the source and delete the derived copy, or regenerate it from the manifest.
Hash the sidecar and retain the source hash it references.
Re-open the new copy, read back GPS latitude and longitude, then hash the produced file.
Archives, cautious workflows and tools that honor XMP companions.
Delivery systems that require GPS inside a compatible image file.
Fail honestly when a format cannot round-trip
A filename extension does not guarantee a metadata writer can preserve that particular file. Copy mode should open the source through the platform image framework, write to a new file, finalize it and re-read the GPS fields. If any step fails, record the failure and offer sidecar mode instead.
Do not claim XMP is universal
Sidecars preserve image bytes, but downstream applications differ in naming conventions and which XMP GPS fields they honor. Test the actual receiving application before relying on a large delivery.