How & where to piggy-back a string "attachment" in metadata

Started by Marsu42, June 05, 2016, 03:05:07 PM

Previous topic - Next topic

Marsu42

Some app of mine I use stores its settings for processed images in a sidecar file (it happens to be a xml text file including some b64 data). For safekeeping, I'd like to attach this sidecar file to the processed image so it won't be lost. The sidecar file size usually is around 1mb. Questions...

1. Which xmp tag is appropriate to store arbitrary string data?
2. How do I attach the "sidecar.txt" file to the "image.tif"?
3. How do I restore the file from the metadata later on?

Thanks for any hints!

Phil Harvey

You could store this in whatever XMP tag you want.  For an example, I'll use XMP:Description.

1. store the XML file for all images in directory "DIR" (assuming it has the same name as the image and extension ".xml"):

exiftool "-xmp:description<=%d%f.xml" DIR

2. restore all of the XML files:

exiftool -xmp:description -b -w %d%f.xml DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Marsu42

Quote from: Phil Harvey on June 05, 2016, 08:59:42 PM
You could store this in whatever XMP tag you want.

Thanks, it always sounds simple in hindsight once I know the command line, but reading through the docs searching for the solution is another matter :-)