Skip to content

Instantly share code, notes, and snippets.

@maxbellec
maxbellec / get_lat_lon_exif_pil.py
Last active December 5, 2023 12:39 — forked from erans/get_lat_lon_exif_pil.py
Get Latitude and Longitude from EXIF using PIL
import PIL.Image
get_float = lambda x: float(x[0]) / float(x[1])
def convert_to_degrees(value):
d = get_float(value[0])
m = get_float(value[1])
s = get_float(value[2])
return d + (m / 60.0) + (s / 3600.0)
def get_lat_lon(info):