Skip to content

Instantly share code, notes, and snippets.

View feliperyan's full-sized avatar

Felipe Ryan feliperyan

View GitHub Profile
@feliperyan
feliperyan / get_lat_lon_exif_pil.py
Created October 23, 2017 12:53 — forked from erans/get_lat_lon_exif_pil.py
Get Latitude and Longitude from EXIF using PIL
from PIL import Image
from PIL.ExifTags import TAGS, GPSTAGS
def get_exif_data(image):
"""Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags"""
exif_data = {}
info = image._getexif()
if info:
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
@feliperyan
feliperyan / exif.py
Created October 22, 2017 11:15 — forked from ishahid/exif.py
Read EXIF data from an image
#!/usr/local/bin/python
"""Read EXIF data from an image
https://gist.github.com/ishahid/137f8724d8cff2304dffd69f3ade26d7
"""
try:
import os, sys
# import json
from PIL import Image