-
Notifications
You must be signed in to change notification settings - Fork 184
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
Incorrect result for ArrayBuffer #49
Comments
Yep, ran into this today. It outputs the same |
Encountered the same issue with array.
Will switch to a different package. |
The code of the npm package is an older version. I think the current version was never released on npm. |
Yes, the current version on NPM does not support I think the author should note about it in |
It's not the same issue. |
thanks, this is work for me |
After my message the package was updated on 2020-08-02. So now it supports Also you do not need to use md5(new Uint8Array(await file.arrayBuffer())) |
This reverts commit 7d5cb1a.
This fixes #361. Here's the whole saga: Here's an example image that works on desktop, but not mobile: https://photos.app.goo.gl/AcEfSrYTMqgp6JfX8 Using [`eruda`](https://www.npmjs.com/package/eruda) to see the JS console with [this branch](#360), I see this on desktop: ```js Extracted GPS latitude/longitude location from EXIF metadata Object {latitude: 40.717019444444446, longitude: -73.99356388888889} ``` but this on mobile: ```js Extracted GPS latitude/longitude location from EXIF metadata Object {latitude: "NaN", longitude: "NaN"} ``` --- Seems like this issue might be within the `exifr` library: https://github.com/MikeKovarik/exifr --- To rule out the possibility that the EXIF metadata is getting stripped when uploaded from my phone, [I logged out the md5sum of the image right before parsing the metadata](4208a1b), and it is `441018525208457705bf09a8ee3c1093` on both desktop and mobile, yet the `GPSLatitude` and `GPSLongitude` arrays are `[NaN, NaN, NaN]` on mobile, but `[40, 43, 1.27]`and `[73, 59, 36.83]` on desktop, respectively. --- related exifr issue: MikeKovarik/exifr#64 --- > [I logged out the md5sum of the image right before parsing the metadata](4208a1b), and it is `441018525208457705bf09a8ee3c1093` on both desktop and mobile Ugh, it looks like the package I chose to use might have a bug that causes this value to show up for ArrayBuffers: pvorb/node-md5#49 --- If I switch to [object-hash](https://github.com/puleos/object-hash), I get a sha1 of `b287c307cd89cfd2ce779b975b961b4824f2714a` on desktop, but it crashes on my phone, so I guess I need something less resource-intensive... --- Seems like Android is stripping GPS from EXIF after all, when the `<input>` element has an `accept` attribute specifying images, but removing the attribute does the trick for me.
Hi! Thanks for the great module! It's worked well for me, but I get the incorrect result for ArrayBuffer input, even if I wrap it in a Uint8Array. For example, and comparing to the js-md5 module:
Checking the hash of the bytes directly via https://cryptii.com/pipes/md5-hash confirms the js-md5 result :
See also: #42
The text was updated successfully, but these errors were encountered: