0.90: some parts of XnView MP only able to read first 7bit of characters of XMP description

Older bugs which are supposed to be fixed in 0.84. *** Please try to reproduce your bug and confirm the bug fix. ***

Moderators: XnTriq, helmut, xnview, Dreamer

User avatar
GeorgD
Posts: 291
Joined: Thu Oct 12, 2006 2:45 pm

0.90: some parts of XnView MP only able to read first 7bit of characters of XMP description

Post by GeorgD »

XnView: MP 0.90 64 bit
OS: Windows 10.0.16299.431 64bit

Dear all,

XnView MP can edit a comment of a picture and read it correctly in XMP side pane but not in the same edit comment dialog - in other words, XnView MP cannot read what it was writing itself :? and reading comments in any language with umlauts, accents etc can become quite difficult if too many characters of the comment have to be guessed.

Reproduction:
1) open a JPG in viewer mode in full screen (F11)
2) press Ctrl+D (edit comment), check embedded comment, write e.g. abc öäüß áàéè
3) move mouse to the right and choose tab XMP (same as in browser mode) - notice the comment looks fine
4) F12 (Settings) > View > Info. Add {IPTC:Headline} {IPTC:Caption} {Comment} {EXIF:User Comment} {Annotation} to the text area. press OK. press i to display information on top left and notice it shows öäüß áà éè
5) press Ctrl+D again, it shows abc öäüß áà éè

Search terms: ANSI, UTF, Unicode, UTF-8, UTF8, Umlaut, Accentm, Diacritics

Best regards, Georg
In the XnView Wiki, you can improve the user guide / documentation / F1-help for XnView (classic/Windows) and for XnViewMP
User avatar
xnview
Author of XnView
Posts: 44920
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 0.90: some parts of XnView MP only able to read first 7bit of characters of XMP description

Post by xnview »

:bugconfirmed: Thanks to your detailed description I can reproduce the problem.

Embedded comment is always written in utf8, doesn't follow settings>Metadata>Encoding
Pierre.
User avatar
xnview
Author of XnView
Posts: 44920
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 0.90: some parts of XnView MP only able to read first 7bit of characters of XMP description

Post by xnview »

This problem is supposed to be fixed in XnView MP 0.91. Please check and confirm the bug fix here.
Pierre.
User avatar
GeorgD
Posts: 291
Joined: Thu Oct 12, 2006 2:45 pm

Re: 0.90: some parts of XnView MP only able to read first 7bit of characters of XMP description

Post by GeorgD »

Hi Pierre, thank you for the update. It's better but not yet completely fine in 0.92 :( but I hope I could outline solutions :)

Fixed: While staying within 1 encoding, Ctrl+D produces correct characters for all tests performed, i.e. it reads exactly what it wrote before under the precondition F12 > Metadata > Encoding is set to the same value during reading the comment as while writing the comment (e.g. "Local" XOR "UTF8").
:idea: While CTRL+D loads comments, could it first try to get comment from XMP (their encoding is always correct) and only if no XMP comment field is found, then load file property's comment? Like that, encoding issues are minimized and even solve them for all users that only use XnView MP (which always writes comment to both XMP and file property).

Still open: Displaying these comments is not reliable both in image overlay information (no display at all or wrong encoding) as well as property tabs (comment always shown but sometimes wrong encoding).

When menu bar > image > show information is active and F12 (Settings) > View > Info contains {IPTC:Headline} {IPTC:Caption} {Comment} {EXIF:User Comment} {Annotation}
  • comment is display instantly for pictures coming directly from camera or that have been edited in XnView MP 0.90
  • comment is not instantly displayed for some pics from Samsung Galaxy S7 that I have edited in XnViewMP 0.92 - but this only with my normal XnView MP installation, whereas with a fresh installation I was unable to reproduce, so it may be due to certain settings. In my normal installation, I once got managed that comments were displayed. I had done several restarts of XnView MP and directory changes and performed several actions, edited images etc. I tried to reproduce but failed. So for those pics, comment display is not completely broken but just unreliable.
  • encoding of Umlauts is sometimes correct but mostly broken like in my initial post (i.e. not <?> instead of actual character like in property tabs (see below) but 2 characters instead of 1 character, so it seems to always assume "Locale" and thus reads 2 characters instead of one character if comment was saved as "UTF8"). :idea: Could you please add XMP comment fields as possible parameters for "Info"? That would minimize the encoding issue and even solve it for all users that only use XnView MP (which always writes comment to both XMP and file property).
In XnView MP's property tabs (browser mode) the comment is always shown instantly in all fields, just encoding issues occur:
  • properties > image > embedded comment encoding is OK when F12 > Metadata > Encoding is set to the same value as while writing the comment (e.g. "Local" at write and read time) but elsewise encoding is broken (depending on direction either <?> instead of actual character or 2 characters instead of 1 character).
  • XMP > dc > description encoding is always OK (probably because XMP is XML that has clear encoding rules),
  • XMP > EXIF > User Comment encoding is always OK, but within EXIF tab and within ExifTool tab > Exif I never found that field => :?: it seems inconsistent that XnView MP writes an EXIF field only within XMP-EXIF metadata and not also within EXIF metadata.
  • ExifTool > File > Comment encoding is broken (<?> instead of actual character) depending on setting of F12 > Metadata > Encoding while writing respectively reading the comment. Please note that ExifTool seems to simply assume UTF8 and not to care about setting of F12 > Metadata > Encoding, because ExifTool tab works for files where comment has been written while F12 > Metadata > Encoding was UTF8 but fails for locale, and because ExifTool tab and property tab can have different results.
  • ExifTool > XMP > User Comment encoding is always OK
  • ExifTool > XMP > Description encoding is always OK
Note that a comment created via CTRL+D is not stored inside IPTC with all settings I tried, hence IPTC is not listed.

:?: Is there no encoding flag for comments in file properties? It seems a little over-simplified / unrealistic that a widely used metadata standard assumes that all pictures a person has will have comments written with the same encoding on all machines that this person and all relatives & friends use.

Note: Related issues are viewtopic.php?f=104&t=35542 and viewtopic.php?f=62&t=28483
In the XnView Wiki, you can improve the user guide / documentation / F1-help for XnView (classic/Windows) and for XnViewMP
User avatar
xnview
Author of XnView
Posts: 44920
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 0.90: some parts of XnView MP only able to read first 7bit of characters of XMP description

Post by xnview »

GeorgD wrote: Sat Oct 27, 2018 9:23 pm Still open: Displaying these comments is not reliable both in image overlay information (no display at all or wrong encoding) as well as property tabs (comment always shown but sometimes wrong encoding).
could you send me samples files to reproduce these errors?
Pierre.