Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed non-Ascii characters in Exiftool output #1169

Closed
herb52 opened this issue Nov 23, 2021 · 9 comments
Closed

Malformed non-Ascii characters in Exiftool output #1169

herb52 opened this issue Nov 23, 2021 · 9 comments

Comments

@herb52
Copy link

herb52 commented Nov 23, 2021

System information:

  • Windows OS version: Windows 10 - UI in German
  • ImageGlass version: 8.3.11.21

To Reproduce

Steps to reproduce the behavior:

  1. For a file (in my case a jpg image) that contains metadata with also e.g. chinese characters and/or also German umlaut characters, these non-Ascii characters are malformed in ExifTool output window
  2. Starting Exiftool with option -lang de, also the German names of tags will contain German umlauts and these are also malformed.

Actual behavior:

In output of Exiftool these non-ascii characters are malformed:
e.g.: Location genau三山 hier
Remark: For test purposes I wrote 2 chinese characters into German text.

Expected behavior:

In given example output:
三山 should be 2 chinese characters: 三山

Screenshots:

grafik

Additional context:

@d2phap
Copy link
Owner

d2phap commented Nov 23, 2021

Can you send me a sample file?
Or can try adding this to Settings > Tools > Exif tool > Command arguments and see if it works

-charset exif=utf8

image

@herb52
Copy link
Author

herb52 commented Nov 25, 2021

Hello,

thanks for your quick reply and also thanks for your great tool ImageGlass.
I answered with mail to your comment. Beeing not sure whether this was the correct way I repeat the mail here:

(1) -charset exif=utf8
As my testfile contains strings with non-ascii characters (and German umlauts) both in EXIF-tags and IPTC-tags (and of course in XMP-tags) I must use the Exiftool options -charset exif=utf8 and also -charset iptc=utf8.
Not using these options ExifTool will not send proper strings because it thinks the strings are Latin1 encoded.

As example I use tags: IPTC:keywords (it is a listtype-tag)
output with option -charset iptc=utf8:
Schlüssel三山wort1, Schlüssel三山wort2
output without this option:
Schlüssel三山wort1, Schlüssel三山wort2

(2) filename with non-ascii characters:
When I display all metadata of a file with a name containing non-ascii characters this name is displayed properly in ExifTool output - as FileName in File section.

(3) testfile
Can I send you this file via a private mail.

Thanks for your investigations in advance.
herb

@d2phap
Copy link
Owner

d2phap commented Nov 25, 2021

@herb52 you can send it to phap@imageglass.org

@fire-eggs
Copy link
Collaborator

One possible cause of the problem here is the command shell used to execute exiftool.

In ExifToolWrapper.cs, these lines:

       private (string stdOut, string stdErr) Open(string cmd) {
            var program = "\"%COMSPEC%\"";
            var args = "/c [command]";

Add the "/u" switch to args to get unicode output, as per "cmd /?":

/U      Causes the output of internal commands to a pipe or file to be Unicode

@herb52
Copy link
Author

herb52 commented Nov 25, 2021

Hello,

thanks fire-eggs for your investigations. Yes, that could cause the problem.
I think it is better to start Exiftool directly, and not as "sub-command" of "cmd"

Best regards
herb52

@fire-eggs
Copy link
Collaborator

I've edited the metadata for the attached image (tumblr...zip) via Win10 properties.

Win10 Properties:

image

ImageGlass:
image

tumblr_e33b8463e398907306287dce8b5f2c9e_9f9ccd16_500.zip

@lifegpc
Copy link

lifegpc commented May 14, 2022

image
image
image
Windows explorer (Windows 10)

I got same issue.
I find the exiftool output string with UTF-8. (My system default encoding is GB2312
The exif data in this image was added by exiv2 library (revelant code).
Image Description(Exif.Image.ImageDescription) was encoded with UTF-8;
XP Title, XP Comment, XP Author was encoded with UTF-16LE.

@herb52
Copy link
Author

herb52 commented Sep 12, 2022

Hello,

can we have please a correction of this annoying error.
And sorry to say: ImageGlass is the only application (I know) that has problems to display the UTF-8 output of ExifTool properly

Best regards

@d2phap
Copy link
Owner

d2phap commented Mar 17, 2023

This issue is fixed in the latest build of ImageGlass Moon 8.7: https://imageglass.org/moon

image

@d2phap d2phap closed this as completed Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants