How to detect thumbnail image segment and value as hex

Started by banana123, February 14, 2024, 10:35:47 AM

Previous topic - Next topic

banana123

Hi

Is there any way to detect thumbnail image segment?

For example - one thumbnail image is at APP1 as part of the EXIF data and another image is part of APP13 as part of photoshop data?

And another question - is there any way to get the value for each metadata field as hex / binary?

Thanks!

StarGeek

Quote from: banana123 on February 14, 2024, 10:35:47 AMFor example - one thumbnail image is at APP1 as part of the EXIF data and another image is part of APP13 as part of photoshop data?

I think they have different names.  ThumbnailImage in the EXIF group and PhotoshopThumbnail in the Photoshop group.  But I don't have PS to be able to check.

QuoteAnd another question - is there any way to get the value for each metadata field as hex / binary?

There's the -b (-binary) option to get the raw data from a tag like the thumbnails, but it won't be separated from any other tag you extract.

Adding the -X (-xmlFormat) option or -j (-json) option will give you the binary data in Base64.  The -php option will encode any non-printable characters in hex.

Another option would be to use something like this (taken from StackOverflow)
s/(.)/sprintf '%04x', ord $1/seg
and use the -api Filter option (note that this would be global, affecting all extracted tags)
-api "Filter=s/(.)/sprintf '%04x', ord $1/seg"
or the -p (-printFormat) option on individual tags
-p "${ThumbnailImage;s/(.)/sprintf '%04x', ord $1/seg"

I haven't tested these last two, so they may require some fixing.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

Quote from: StarGeek on February 14, 2024, 11:23:17 AMThere's the -b (-binary) option to get the raw data from a tag like the thumbnails, but it won't be separated from any other tag you extract.

...unless you use the -W (capital "W") output option with %t (tag name) or %c (copy number) in the file name string.

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