Author Topic: How to write Latin1-encoded IPTC-values?  (Read 5229 times)

van Dusen

  • Newbie
  • *
  • Posts: 7
How to write Latin1-encoded IPTC-values?
« on: May 31, 2011, 11:24:55 AM »
Concerns ExifTool.exe v8.57 on WinXP Pro SP3

As far as my experience goes, IPTC tags will be written always UTF8-encoded. Is there still any way to store values of IPTC tags Latin1 encoded?

According the ExifTool documentation you can do the following:

Quote
The following command changes the internal IPTC encoding to UTF-8:
   exiftool -tagsfromfile @ -iptc:all -codedcharacterset=utf8 {File.jpg}
and this command changes it back from UTF-8 to Windows Latin1 (cp1252):
   exiftool -tagsfromfile @ -iptc:all -codedcharacterset=  {File.jpg}
or this command changes it back from UTF-8 to Windows Latin2 (cp1250):
   exiftool -tagsfromfile @ -iptc:all -codedcharacterset= -charset iptc=latin2  {File.jpg}


Unfortunately, I can't reproduce this, when I try the following:

0. Initial:

Code: [Select]
IPTC:CodedCharacterSet ... utf8
IPTC:{TagName} ........... Umlaute äöüß
..................(Binary: Umlaute äöüß)


1. Execute: ExifTool -tagsFromFile @ -IPTC:All -CodedCharacterSet= {Image file}

Expected result:
Code: [Select]
IPTC:CodedCharacterSet ... {n.a.}
IPTC:{TagName} ........... Umlaute äöüß
..................(Binary: Umlaute äöüß)

Actual result:
Code: [Select]
IPTC:CodedCharacterSet ... {n.a.}
IPTC:{TagName} ........... Umlaute äöüß
..................(Binary: Umlaute äöüß)

Why stays IPTC:{TagName} UTF8 encoded and isn't converted to Latin1?


2. Execute: ExifTool -tagsFromFile @ -IPTC:All -CodedCharacterSet=utf8 {Image file}

Converting back to UTF8 will change apparently nothing.
Actual result:
Code: [Select]
IPTC:CodedCharacterSet ... utf8
IPTC:{TagName} ........... Umlaute äöüß
..................(Binary: Umlaute äöüß)


And just out of curiosity:

3. Execute: ExifTool -IPTC:CodedCharacterSet= {Image file}

Actual result:
Code: [Select]
IPTC:CodedCharacterSet ... {n.a.}
IPTC:{TagName} ........... Umlaute äöüß
..................(Binary: Umlaute äöüß)

Apparently it is a bad idea just to delete the IPTC:CodedCharacterSet tag...

Thanks a lot in advance,
greetings, van Dusen


Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14405
    • ExifTool Home Page
Re: How to write Latin1-encoded IPTC-values?
« Reply #1 on: May 31, 2011, 11:44:44 AM »
You can write IPTC in whatever encoding you like.

I think that reading FAQs number 10 and 18 may help explain this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

van Dusen

  • Newbie
  • *
  • Posts: 7
Re: How to write Latin1-encoded IPTC-values?
« Reply #2 on: June 01, 2011, 06:07:03 PM »
Hello Phil,

thanks for your quick reply. It was indeed my fault, actually everything works as it should. I had validated the results by extracting the tags using the "-b(inary)" option and I didn't reckon, that a charset conversion is done (here: output had been converted to UTF8 in each case) even if the "-b" option is set (at least for tags other than "Binary" type, I assume). I found, that option "-v4"/"-v5" is better suited for validation purposes.