-
Notifications
You must be signed in to change notification settings - Fork 53
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
wrong encoding on exif strings (bug) #11
Comments
This should be hard.. I expect that this library expects UTF8 as encoding.. but your example looks like some 8bit encoding is used instead? |
I'm not sure if UTF-8 is in the EXIF specs. The image descriptions were edited by Adobe Lightroom, but Adobe sometimes hates standards (check the SVG export of Illustrator 👎 ). |
Hi I figured this out. Using |
@langpavel I just found that the bug still exists. Did you fork the lib to resolve it? seems that PRs are not actively worked on anymore... or did you find a better lib? |
Hi, I have no time to work on this, sorry.. |
EXIF assumes ASCII and doesn't have a field to specify an encoding, so without using an encoding detection library, this will be hard to do. Since this library needs to work in the browser as well as in node.js, I'd be hesitant to add a big thing like encoding detection to it. |
I did notice that on node.js, the library forcefully decodes using ASCII, while in the browser it uses UTF16 (Compatible with ASCII). Ideally, on both platforms it should decode using UTF-8, since that's what's most widely used and compatible with ASCII as well. Your example text might be encoded with UTF-8 as a matter of fact. Browser support for UTF-8 is not ubiquitous, so might be hard to do cross-platform, I'll have a look. |
Released 0.1.11 that uses utf-8 for nodejs. If you want, you could test if the description in your image decodes properly now on nodejs. For the browser, we'd have to use TextEncoder if supported, and revert to fromCodePoint and fromCharCode if not. Don't have time to do this right now, but you're welcome to make a PR. |
@acidicX if this issue is still a problem for you could you share the image that causes you problems so others can look at it and try to fix/suggest changes? |
|
Hey there,
first things first: thanks for the module!
I'm having encoding problems with certain EXIF strings, e.g. the
ImageDescription
This is what other EXIF readers tell me:
Fahrt über den Ozean
but I am getting this with exif-parser:
Fahrt C<ber den Ozean
Seems to me like they are not read with the proper encoding.
I'd fix it myself, but I have no idea how the tags are encoded in the first place :/
Cheers,
acidicX
The text was updated successfully, but these errors were encountered: