I run ExifTool on Linux.
The tag
ICC_Profile:CharTarget in the JSON-output containes a trailing
\u0000.
It looks like it should not be part of the value.
This problem occurs with the attached image.
exiftool -j -G -ICC_Profile:CharTarget image.jpgThe attached diff for Version 10.76 fixed this for me.
patch lib/Image/ExifTool/ICC_Profile.pm patch.diffQuote9.2.14 charTargetTag
...
If the first seven characters are "ICCHDAT", then the remainder of the text shall be a single space followed by
the Reference Name of a characterization data set in the Characterization Data Registry maintained by ICC,
and terminated with a NULL byte (00h). ...
http://www.color.org/specification/ICC1v43_2010-12.pdf (http://www.color.org/specification/ICC1v43_2010-12.pdf)
Great, thanks for this patch!
- Phil
I noticed that ICC_Profile:CharTarget is not the only tag with a \u0000 problem.
1)
Most \u0000 are trailing in JSON-strings. (e.g. "ABC\u0000\u0000\u0000\u0000").
I added $str =~ s/\0+$//mg to EscapeJSON().
I am not sure if this is the right way, but it is most likely that many JSON-Parser and String-Implementations cannot handle the NULL character, because this indicates the end of a string.
2)
\0+ seems to be the end of a ListEntry for IPTC:DocumentHistory.
Every entry is padded with \0 to 256 characters.
I added ValueConv => '$val =~ s/\0+/\n/g; $val'.
Maybe here is a better way too.
Unfortunately, I am not able to execute exiftool -tagsfromfile f1.jpg -EXIF:UserComment -IPTC:DocumentHistory f2.jpg successfully.
ExifTool prints "Warning: Can't convert value for IPTC:DocumentHistory (no ValueConvInv)" and "Invalid EXIF text encoding for UserComment".
Is there a way to copy invalid tags, so I can upload examples. (I do not want to upload the original files.)
How about the attached patch to remove nulls from the JSON output?
- Phil
Edit: Oh. I see that you have done a similar thing already (your point number 1).
You can add "ValueConvInv => '$val'," to get rid of the "No ValueConvInv" warning.
For examples, you can copy the entire IPTC or EXIF block containing the questionable information (with -iptc or -exif).
Is the else-branch really required?
The function returns in the if-branch.
You're right. The "else" isn't necessary.
I managed to create an example picture for point number 2. (See Attachments)
OK, thanks. I'll apply your patch to deal with this.
- Phil
When is the next release version, containing this patches, planned?
It was released on Sunday.
- Phil
Sorry, I wanted to write production release version.
Is there a date for this?
Probably in about a week or so.
- Phil