exiftool "-exif:xpComment>exif:UserComment" 090704-153454.jpg

Started by roger, June 28, 2013, 09:35:55 AM

Previous topic - Next topic

roger

xpcomment (which is in Unicode) contains "maman" ( 6D 00 61 00 6D 00 61 00 6E 00)
the UserComment resulting is wrong (reversed): UNICODE  00 6D 00 61 00 6D 00 61 00 6E
the coding of  090704-153454.jpg file is "MM".

it is the same with non ASCII comment (pure Unicode string)



Phil Harvey

Hi Roger,

Why do you say it is wrong?

The Exif specification doesn't specify a byte order for UNICODE strings, so the only reasonable assumption is that the byte order is the same as that of the Exif container, which is how this is written by ExifTool.  This is also the recommendation of the MWG.

The XP-tags, on the other hand, are always little-endian.

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

roger

Hi Phil,
many thanks for your fast answer.
it seemed to me (sorry for having been so rude) that it was wrong because
- inside the same file, the fields XPcomment and UserComment are written in reverse order
- XNview, Irfanview, ExifManager, QuickExifwriter unicode cannot display correctly this UserComment
- but JPEGView does it (but I don't know weither it displays UserComment or XPcomment).

so, I don't know what to do.

regards.

Phil Harvey

Hi Roger,

I believe that ExifTool is writing this correctly (and you should probably report this as a bug to the other utilities that don't display this properly), but ExifTool also allows you to change this by setting the ExifUnicodeByteOrder tag when writing.  See the Extra tags documentation for details.  So writing the tag with -ExifUnicodeByteOrder=II may at least allow you to make the other utilities happy until they fix this problem.

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

roger

Hi Phil

you are right. that's great! 
and sorry for disturbing you.

roger.

ps: do I have to close this topic? don't know how to do it.

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