hMatoba / Piexif

Exif manipulation with pure python script.
MIT License
367 stars 81 forks source link

GPSTrack #123

Closed AdrianKriger closed 2 years ago

AdrianKriger commented 2 years ago

Hi;

How would I convert the rational64u GPSTrack into a direction?

with:

import piexif
exif_dict = piexif.load('./img/IMG_1146.jpg')
h = exif_dict['GPS'][piexif.GPSIFD.GPSTrack]
h

we get: (116001, 424) with metapix the result is: GPSTrack 273.5872642. An example image here.

What must I do to (116001, 424) to get a bearing?

AdrianKriger commented 2 years ago

solved @ stackoverflow

degree = numerator / denominator = h[0]/ h[1] = 116001 / 424 = 273.587264150943