Binary data not extracted for some tags

Started by volker, March 22, 2018, 12:00:44 PM

Previous topic - Next topic

volker

Hi Phil,

I have a problem extracting some binary data, e.g. DustRemovalData from Canon files. Using

exiftool -json -a -e -G1:4 -n -s -struct CanonEOS500D.jpg

the output contains

"Canon:DustRemovalData": "(Binary data 1024 bytes, use -b option to extract)"

But, if I add the -b option to the command, the output does not contain this tag at all. While trying to understand the reason for this, I found the code starting at line 2135 in exiftool (version 10.87) seems to cause this:

if (defined $binaryOutput and not $binaryOutput and $$et{TAG_INFO}{$tag}{Protected}) {

Is this the expected behavior, or is it a bug? If it is expected, how can I identify the tags which will be suppressed?

Thanks,
Volker

Phil Harvey

Hi Volker,

Very good sleuthing!

In general, this is done to prevent large binary data blocks from being copied unless they are specified explicitly.  I can't recall now why this was done for the -X, -j and -php options, but it was certainly intentional.

This will affect any tag with the "Binary" and "Unsafe" flags set in the -listx -f output.  Unsafe tags are denoted in the tag name documentation with a "!" after their writable type.

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

volker

Hi Phil,

Thanks for the quick answer. It only affects 37 tags, and they don't seem important for us.

Volker