How to embed zip into metadata?

Started by megapro17, March 22, 2025, 08:17:39 AM

Previous topic - Next topic

megapro17

I want to embed zip archive into a metadata, ideally without encoding into base64. I've tried this command, but it hangs with consuming around 3 gb or ram, when trying to embed 13 mb zip into 6 mb jpeg.
exiftool -Comment<="112PHOTO.zip" DSC00007.JPG
Some other tags simply do not allow me to do that: Not a valid image for IFD0:JpgFromRaw
Is there any compatible tag for this, or ability to override a warning?

Phil Harvey

Due to the 64 kB segment-size limit on for a JPEG file, any large embedded file like this would need to be broken up.

So how about this instead?:

exiftool "-trailer<=112PHOTO.zip" DSC00007.JPG

The disadvantage of this is that the trailer will be lost if the file is manipulated by basically any other software.

- 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 ($).

megapro17

thumbnails, previews, etc in jpeg format are stored differently, so they don't need segmenting? Because they are embedded instantly, without noticable overhead.
Among all the variety of tags, there is no support for archives implemented anywhere?

I thought about rarjpegs, didn't know exiftool implemented this idea. I'll try it, thanks

Phil Harvey

Thumbnails are small enough to fit in the EXIF segment, although multiple EXIF segments are possible, they aren't common or widely supported.  Previews are usually stored in the trailer with the MPF technique.

I could look into why spitting a 13 MB COM segment takes so long, but honestly I don't know if it is worth the effort because I don't think that storing binary data in a text field is a good idea.

- 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 ($).

StarGeek

Quote from: megapro17 on March 22, 2025, 09:50:27 AMAmong all the variety of tags, there is no support for archives implemented anywhere?

No. Other than Phil's suggestion, the best you could try to do is Base64 encode it and stick it in an XMP field, as XMP can be split across multiple JPEG blocks.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype