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
unpack error after adding and then removing exif info #9
Comments
I thought that "\xff\xe1" is enough information to conclude a segment is exif or not, but it's not enough. Adobe XMP also have "\xff\xe1". I'll fix it this weekend. |
Fixed. |
Hi, Thanks for the fix. Although it fixed the unpack error. It doesn't remove the exif info after inserting. But it removes it if we call remove the second time. I think you must update your removal function appropriately to cater for this. Following is the debugging info before removal, something is fishy. See the duplicate segments. Please use below html to reproduce the problem. I am first inserting exif to original image and then removing. This removing doesn't work. But removing again works.
|
Fixed. |
Awesome! Thanks. |
Thank you for letting me know. |
I had to add/update some exif information to image and then remove all information later on. Using this library, I was able to add exif info to the image but wasn't being able to remove after adding, due to unpack: mismatch error on line 801. This issue was found for some images.
My change:
Line no 41 to 45 of piexif.js.
You check occurrence of "ÿá" character at segment index 1 and then at index 2. If found you remove that segment. However in my case, this character was occurring twice at two different segments which was causing issue.
I have written a loop to check for all such segments starting with "ÿá", and removed that segment if found. Is this approach correct?
e.g.
This resolves error on my side for all images. But I am not sure if this is how you would have done it!
Code in html:
The text was updated successfully, but these errors were encountered: