-
Notifications
You must be signed in to change notification settings - Fork 2
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
utf8 metadata not displayed properly #19
Comments
I know next to nothing about EXIF, but a quick search seems to hint that utf8 is often used to encode non-ASCII metadata.
A quick look at the hex dump of that PNG file shows that the metadata is indeed utf8-encoded:
|
@pitrou, thanks for reporting! To be honest I don't know much about Exif-parsing either ;-) Especially when it comes to parsing binary Exif data, which seems be the only kind in "your" image. The Exif and meta-data parsing code in xIFr, I have inherited from wxIF and only made minor changes to (xIFr is a fork from the wxIF). But as soon as I find some time, I will try to dig into this and see if I can find a way to make xIFr handle this without breaking anything already working. And thanks for the work you have done for describing and analysing this issue, instead of just simply saying it doesn't work! :-) |
https://civitai.com/images/5272231 |
While exiftool's home page doesn't explicitly acknowledge the TIFF encoding method (an 8-byte header inside userComment) it recognizes and supports that method. |
If xIFr could be fixed so it also can show those Stable Diffusion prompts, it would definitely be nice. |
I've done further research and this is actually the EXIF/TIFF specs' fault in part because while they permit Unicode in The key thing here is that the only reason ExifTool is able to consistently return a readable value from |
@duanemoody thanks for the further analysis and the Civitai request. |
FYI. It's not me who have written these parts of the code in xIFr, but I see 4 different "bytes-to-string" functions used in xIFr.
And also a TextDecoder is in use in xmp.js:
Do you think I have the "building-blocks" to get any of these issues fixed? |
I'm trying out the xifr extension so I choose a news article at random since they often come with illustrations.
On https://www.letelegramme.fr/ille-et-vilaine/rennes-35000/accuse-davoir-empeche-lexpulsion-de-lattaquant-darras-manuel-valls-repond-6448696.php , the metadata of the main article photo displays like this:
The unexpected characters in the description are a symptom of utf8-encoded text being displayed as if it were in another character set (such as latin-1 / iso-8859-1).
For example, "Défense" is exactly what you get when you take the word "Défense", encode it as utf8, and then decode it as latin1. See Python snippet:
The text was updated successfully, but these errors were encountered: