wrong recoding of exif (and probably IPTC (IIM))

Started by mikmach, November 10, 2016, 06:45:37 AM

Previous topic - Next topic

mikmach

Hello,

I have file in utf-8 (ta.txt in attachment) with Polish diacriticts:


zażółć gęślą jaźń


I am trying to write it in various metadata fields and encodings which cover Polish user cases with command:


./exiftool -codedcharacterset= -charset exif=cp1250 -charset iptc=cp1250 "-MWG:Copyright<=ta.txt" "-MWG:Creator<=ta.txt" plasma100.jpg


Output of relevant fields (in cp1250 encoding):

[EXIF]          Artist                          : zażółć gęślą jaźń
[EXIF]          Copyright                       : zaĹĽĂłĹ,ć gęślÄ... jaĹşĹ,,.
[IPTC]          By-line                         : za¿ó³æ gĂŞĹ"lÂą jaŸñ.
[IPTC]          Copyright Notice                : za¿ó³æ gĂŞĹ"lÂą jaŸñ.

(dropped XMP lines because it is working as should be)
Desired effect should be all four lines identical:

[EXIF]          Artist                          : zażółć gęślą jaźń
[EXIF]          Copyright                       : zażółć gęślą jaźń
[IPTC]          By-line                         : zażółć gęślą jaźń
[IPTC]          Copyright Notice                : zażółć gęślą jaźń

Especially puzzling is difference in EXIF lines because looks like first field was transcoded into cp1250 and second stays in utf-8. If I transcode lines into utf-8 output is:

[EXIF]          Artist                          : za???? g??l? ja??
[EXIF]          Copyright                       : zażółć gęślą jaźń.
[IPTC]          By-line                         : za?ó3a geol1 jaYn.
[IPTC]          Copyright Notice                : za?ó3a geol1 jaYn.


Note also that IPTC is complete garbage in no encoding known to me (although looks like it was going through latin1 somehow, some replacements are characteristic).

exiftool 10.32 (not that my whole setup is a bit convoluted, Windows version of exiftool in cygwin defaulting to utf-8).

Even if this is result of conflict with MWG it should treat both EXIF fields the same way. If I set EXIF fields directly (without MWG) it works OK but IPTC is still broken.

Phil Harvey

Thanks for this report.

The IPTC is fine, and should display properly if you add -charset iptc=cp1250 when reading.

There is a problem with the EXIF:Copyright which will be fixed in ExifTool 10.33.  The problem arises from the fact that this tag is not a simple string in the EXIF specification (it is a concatenation of two strings), and so is treated differently than EXIF:Artist.

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