Full list of all the "official" places in JPEG/JFIF/EXIF for thumbnails/previews

Started by hippietrail, May 29, 2023, 11:17:22 AM

Previous topic - Next topic

hippietrail

I'm writing some code for fun and curiosity to explore metadata (again).

I see that there are various places in ".jpg" files where either a thumbnail or a preview image can be embedded.

It seems to be hard to find a full list on the internet but I'm certain this is a place with several people with expert domain knowledge.

I know that a ".jpg" file can actually be a JPEG, a JFIF, or an EXIF file. (Or a hybrid with both APP0 and APP1 sections.)

I'm pretty sure that at least two of those have their own way to embed a thumbnail or preview. One embeds a full image file and one I think just stores a bitmap of fixed size.

Then I'm sure XMP can also include a text-encoded binary thumbnail or preview.

And I think I just read that even IPTC metadata can include a thumbnail or preview image.

I'm not sure if it's technically plausible for XMP to actually include an EXIF or IPTC thumbnail or preview too. I'm sure it would be rare but I'm curious if it's at least theoretically possible or not.

For this question I'm not asking about "undocumented" or "unofficial" thumbnail or preview images within MakerNote sections.

Also is it ever possible for any of the "normal" thumbnail or preview images to somehow be included more than once? Or perhaps there are some edge cases I haven't thought of.

Bonus question: Using standard *nix tools together with ExifTool, how would I search my machine for all the .jpg files that have any kind of thumbnail or preview images in them?

I've tried a few ways but it looks like they're much rarer than I expected or I'm doing it wrong. Also there's quite a few false positives with the words "thumbnail" or "preview" in the filename, path, or even in some metadata tags that don't seem to be for embedded images.

Bonus 2: Is there somewhere a collection of sample images using each of these types of thumbnail or preview image for testing purposes?

hippietrail

I probably should've posted this question to General/Metadata so my apologies. It seems I can't move it or delete it from here and repost it there though.

Phil Harvey

XMP may indeed include a thumbnail in the standard XMP-xmp tags.

IPTC may contain ObjectPreviewData (although uncommon).

MPF is a standard used by a few manufacturers to embed previews in JPEG.

And of course, EXIF APP1 is for the standard EXIF thumbnail in JPEG images.

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

hippietrail

So those four, XMP, IPTC, MPF, and EXIF APP1, plus JFIF APP0 Xthumbnail/Ythumbnail/Thumbnail data would be the complete set for .jpg, including rarely used ones but excluding proprietary ones in makernotes?

Extrapolating from this, am I correct in assuming that PNG can therefore contain all of these theoretically as well, except for JFIF APP0?

Can exiftool add each of these types to .jpg? (I'm assuming it can't add any, at least directly, to PNG as I'm assuming they are very rarely used.)

StarGeek

Quote from: hippietrail on May 30, 2023, 12:05:52 AMCan exiftool add each of these types to .jpg? (I'm assuming it can't add any, at least directly, to PNG as I'm assuming they are very rarely used.)

It can vary.  You can check the writable column in the various Tags Names pages or use the Tag Name List PDF.  I find the latter easiest when I'm not sure what group a tag might belong to.
"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