-
Notifications
You must be signed in to change notification settings - Fork 20
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
Divide by zero error #12
Comments
How does the error message look like? Would you please paste complete output here? |
Unforunately it's not giving me much info, I'm guessing because it's calling out to C. Here's all I get:
|
I've found a public image that I can reproduce with: https://dtphgwb5vjcez.cloudfront.net/focus/gallery/27/2749/dji-phantom-4-pro-ad33b6ab.jpg My leading theory right now is that it's related to GPS parsing, as I couldn't get it to fail until I found an image with GPS data in it, but that might be a coincidence. |
Seems like the error happens when numerator and denominator are both zero (take ExposureIndex for example). So far I have no idea how to handle this scenario since 0/0 is not a valid rational number. |
Maybe we can make it return |
Ah I see. |
I surveyed some other libraries:
Currently There are several proposals:
I need more time to analysis pros and cons for each one. |
Fair point. In that case, it seems returning a float makes the most sense as it's the type that a consumer would be expecting. A tuple or an array changes the format, but they prevent any loss of information. I don't know enough about EXIF to know if that information loss is important. |
Umm... I just thought for another moment, maybe returning either |
Thanks for your support @tonytonyjan, I really appreciate it. :) I've got my use case working, so all good on my end now. I have run into one other issue around character encoding that I thought I'd let you know about. It's not really a bug though, so feel free to disregard if it's not something that concerns you. Basically, some of the fields in the EXIF aren't unicode, so converting to JSON doesn't always work. Work around is pretty simple:
|
Hi @tonytonyjan, you helped me with an issue to do with orientation in this issue. I've opted to try to upgrade to
2.0.0
as my C is a bit too rusty to contribute code directly. :)Unfortunately I've run into a divide by zero error in
2.0.0
. I can extract using the CLI tool. Unfortunately I can't attach one of the images giving me trouble as I don't own them, but I've scrubbed some EXIF data which will hopefully give you something.To produce, I'm just doing:
And the CLI output (I've removed sensitive info):
Please let me know if there's anything else I can do to help debug, happy to try branches or whatever else is useful.
The text was updated successfully, but these errors were encountered: