News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

-php Truncates ICC_Profile 80 Bytes

Started by Glenn Butcher, January 07, 2020, 08:05:26 PM

Previous topic - Next topic

Glenn Butcher

I'm messing with cpp_exiftool to determine what a C++ metadata class would look like for my hack raw processor.  In efforts to code getICCProfile(), the binary data returned in TagInfo is 80 bytes shorter than what exiftool at the command line reports for the profile.  I did an exiftool -php -ICC_Profile, and the PHP array does seem to be truncated after the last non-zero character.

Here's my C++ call to ImageInfo();

TagInfo *info = et->ImageInfo(filename.c_str(),"-b\n-ICC_Profile",5);

Phil Harvey

Thanks for this report.  I can reproduce this here.  I'll look into this first thing tomorrow and report back when I know more.

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

Phil Harvey

I've just released ExifTool 11.82 with a patch to fix this problem.

Thanks again for the report.

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

Glenn Butcher

You're most welcome.  Thanks for carving out the time to consider this.

I'm working on a C++ metadata class that uses exftool and/or exiv2, to integrate into my hack raw processor.  I'll let you know how that goes...

Glenn Butcher

I hate to be a pill, but with the 11.82 exifttool the C++ interface doesn't seem to recognize binary values anymore.  Where a \x-encoded binary array used to come out of exiftool, now the value is "HASH(somebignumber)", looking like a perl reference.  I played with the ImageInfo tags, and found I could get the encoded value if I removed -l and -D, but the routine still doesn't decode it (the lengths returned are 0).  I tested it with -ICC_Profile and -PreviewImage, same result.

Phil Harvey

Does the same thing happen with 11.81?

My tests with 11.82 using -php -b -icc_profile worked fine.  Can you compare the output of this command for a version that works for you and one that doesn't?

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

Glenn Butcher

ver 11.82.

1.  exiftool -php -b -ICC_Profile DSG_3111.jpg yields:

Array(Array(
  "SourceFile" => "DSG_3111.jpg",
  "ICC_Profile" => "\x00\x00\x05hlcms\x02 \x00\x00mntrRGB XYZ \x07▒\x00\x04\x00\x16\x00\x15\x00\r\x00\"acspAPPL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00▒▒\x00\x01\x00\x00\x00\x00▒-lcms\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0Bcprt\x00\x00\x01\x08\x00\x00\x00▒wtpt\x00\x00\x01▒\x00\x00\x00\x14bkpt\x00\x00\x01▒\x00\x00\x00\x14rXYZ\x00\x00\x01▒\x00\x00\x00\x14gXYZ\x00\x00\x01▒\x00\x00\x00\x14bXYZ\x00\x00\x01▒\x00\x00\x00\x14rTRC\x00\x00\x02\x04\x00\x00\x00\x0EgTRC\x00\x00\x02\x14\x00\x00\x00\x0EbTRC\x00\x00\x02\$\x00\x00\x00\x0Edmnd\x00\x00\x024\x00\x00\x02▒desc\x00\x00\x04▒\x00\x00\x00▒text\x00\x00\x00\x00Copyright 2016, Elle Stone (http://ninedegreesbelow.com/), CC-BY-SA 3.0 Unported (https://creativecommons.org/licenses/by-sa/3.0/legalcode).\x00\x00\x00\x00XYZ \x00\x00\x00\x00\x00\x00▒Q\x00\x01\x00\x00\x00\x01\x16▒XYZ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00XYZ \x00\x00\x00\x00\x00\x00o▒\x00\x008▒\x00\x00\x03▒XYZ \x00\x00\x00\x00\x00\x00b▒\x00\x00▒▒\x00\x00\x18▒XYZ \x00\x00\x00\x00\x00\x00\$▒\x00\x00\x0F▒\x00\x00▒▒curv\x00\x00\x00\x00\x00\x00\x00\x01\x023\x00\x00curv\x00\x00\x00\x00\x00\x00\x00\x01\x023\x00\x00curv\x00\x00\x00\x00\x00\x00\x00\x01\x023\x00\x00desc\x00\x00\x00\x00\x00\x00\x00▒sRGB chromaticities from A Standard Default Color Space for the Internet - sRGB, http://www.w3.org/Graphics/Color/sRGB; also see http://www.color.org/specification/ICC1v43_2010-12.pdf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00▒\x00s\x00R\x00G\x00B\x00 \x00c\x00h\x00r\x00o\x00m\x00a\x00t\x00i\x00c\x00i\x00t\x00i\x00e\x00s\x00 \x00f\x00r\x00o\x00m\x00 \x00A\x00 \x00S\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00 \x00D\x00e\x00f\x00a\x00u\x00l\x00t\x00 \x00C\x00o\x00l\x00o\x00r\x00 \x00S\x00p\x00a\x00c\x00e\x00 \x00f\x00o\x00r\x00 \x00t\x00h\x00e\x00 \x00I\x00n\x00t\x00e\x00r\x00n\x00e\x00t\x00 \x00-\x00 \x00s\x00R\x00G\x00B\x00,\x00 \x00h\x00t\x00t\x00p\x00:\x00/\x00/\x00w\x00w\x00w\x00.\x00w\x003\x00.\x00o\x00r\x00g\x00/\x00G\x00r\x00a\x00p\x00h\x00i\x00c\x00s\x00/\x00C\x00o\x00l\x00o\x00r\x00/\x00s\x00R\x00G\x00B\x00;\x00 \x00a\x00l\x00s\x00o\x00 \x00s\x00e\x00e\x00 \x00h\x00t\x00t\x00p\x00:\x00/\x00/\x00w\x00w\x00w\x00.\x00c\x00o\x00l\x00o\x00r\x00.\x00o\x00r\x00g\x00/\x00s\x00p\x00e\x00c\x00i\x00f\x00i\x00c\x00a\x00t\x00i\x00o\x00n\x00/\x00I\x00C\x00C\x001\x00v\x004\x003\x00_\x002\x000\x001\x000\x00-\x001\x002\x00.\x00p\x00d\x00f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00desc\x00\x00\x00\x00\x00\x00\x00\x18sRGB-elle-V2-g22.icc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00s\x00R\x00G\x00B\x00-\x00e\x00l\x00l\x00e\x00-\x00V\x002\x00-\x00g\x002\x002\x00.\x00i\x00c\x00c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
));

Goodness.

1. From the C++ ExifTool::ExtractInfo() method, exiftool -b -php -l -G:0:1:2:4 -D -sep , -ICC_Profile DSG_3111.jpg yields:

Array(Array(
  "SourceFile" => "DSG_3111.jpg",
  "ICC_Profile:ICC_Profile:Image:ICC_Profile" => "HASH(0x5651f9c40ad0)"
));


Phil Harvey

Ah, right.  The -D option causes the return value to be converted into a HASH.  Sorry, I completely missed this.

I have just released ExifTool 11.83 which should hopefully solve the problem properly this time.

Thanks for following up on this.

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

Glenn Butcher


Phil Harvey

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