Did you know that you can get EXIF data from JPG image files using the Python programming language? You can use Pillow, the Python Imaging Library’s friendly fork to do so. You can read an article about that on this website if you want to.
Here is some example code for getting regular EXIF data from a JPG file:
# exif_getter.py
from PIL import Image
from PIL.ExifTags import TAGS
def get_exif(image_file_path):
exif_table = {}
image = Image.open(image_file_path)
info = image.getexif()
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
exif_table[decoded] = value
return exif_table
if __name__ == "__main__":
exif = get_exif("bridge.JPG")
print(exif)
This code was run using the following image:
In this article, you will focus on how to extract GPS tags from an image. These are special EXIF tags that are only present if the camera that took the photo had its location information turned on for the camera. You can also add GPS tags on your computer after the fact.
#python #big data #jpg