ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Marsu42 on June 05, 2016, 03:05:07 PM

Title: How & where to piggy-back a string "attachment" in metadata
Post by: Marsu42 on June 05, 2016, 03:05:07 PM
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!
Title: Re: How & where to piggy-back a string "attachment" in metadata
Post by: Phil Harvey on June 05, 2016, 08:59:42 PM
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
Title: Re: How & where to piggy-back a string "attachment" in metadata
Post by: Marsu42 on June 05, 2016, 10:23:36 PM
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 :-)