Skip to content
Advertisement

Django Exif Data: ‘IFDRational’ object is not subscriptable

I got an issue with the code: ‘IFDRational’ object is not subscriptable

Here is the trace:

JavaScript

the is issue is: Variable Value dms (45.0, 46.0, 34.29) ref ‘N’

JavaScript

That what I get from an image for instance. I think the code assimilate GPSLatitudeRef to degrees = dms[0][0] / dms[0][1]. The thing is GPSLatitudeRef is a letter none a number.

JavaScript

Advertisement

Answer

I cannot comprehend why degrees = dms[0][0] / dms[0][1] is necessary when you can simply extract degrees from the tuple using degrees = dms[0]

Replace

JavaScript

With

JavaScript
Advertisement