Skip to content
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

develop branch: GPS information erroneously None #96

Closed
chrstphrchvz opened this issue May 11, 2019 · 2 comments · Fixed by #98
Closed

develop branch: GPS information erroneously None #96

chrstphrchvz opened this issue May 11, 2019 · 2 comments · Fixed by #98

Comments

@chrstphrchvz
Copy link
Contributor

chrstphrchvz commented May 11, 2019

As of ea5af10 the GPS information is not reported correctly.

Before:

$ EXIF.py /exif-samples/jpg/gps/DSCN0021.jpg
…
GPS GPSAltitudeRef (Byte): 0
GPS GPSDate (ASCII): 2008:10:23
GPS GPSImgDirectionRef (ASCII): 
GPS GPSLatitude (Ratio): [43, 28, 149399999/100000000]
GPS GPSLatitudeRef (ASCII): N
GPS GPSLongitude (Ratio): [11, 53, 433799999/100000000]
GPS GPSLongitudeRef (ASCII): E
GPS GPSMapDatum (ASCII): WGS-84   
GPS GPSSatellites (ASCII): 06
GPS GPSTimeStamp (Ratio): [14, 36, 4723/100]

After:

$ EXIF.py /exif-samples/jpg/gps/DSCN0021.jpg
…
GPS GPSAltitudeRef (Byte): 0
GPS GPSDate (ASCII): 2008:10:23
GPS GPSImgDirectionRef (ASCII): 
GPS GPSLatitude (Ratio): [None, None, None]
GPS GPSLatitudeRef (ASCII): N
GPS GPSLongitude (Ratio): [None, None, None]
GPS GPSLongitudeRef (ASCII): E
GPS GPSMapDatum (ASCII): WGS-84   
GPS GPSSatellites (ASCII): 06
GPS GPSTimeStamp (Ratio): [None, None, None]

Cc @cdusold (author of #72) in case of comment.

@chrstphrchvz chrstphrchvz changed the title develop branch: GPS coordinate information erroneously None develop branch: GPS information erroneously None May 11, 2019
@chrstphrchvz
Copy link
Contributor Author

I notice that exifread.Ratio() only returns anything when the denominator is 0, so maybe the issue is due to an extra indent on the return statement:

# We're immutable, so use __new__ not __init__
def __new__(cls, numerator=0, denominator=None):
try:
self = super(Ratio, cls).__new__(cls, numerator, denominator)
except ZeroDivisionError:
self = super(Ratio, cls).__new__(cls)
self._numerator = numerator
self._denominator = denominator
return self

@cdusold
Copy link
Contributor

cdusold commented May 11, 2019

Oops. That looks like it was the problem. Thanks, and sorry about that.

ianare pushed a commit that referenced this issue Jul 24, 2019
May have been due to an accidental extra indent
before the `return` statement.

Fixes #96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants