Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

load image metadata with pil

import PIL.Image
img = PIL.Image.open('img.jpg')
exif_data = img._getexif()

# iterating over all EXIF data fields
for tag_id in exif_data:
    # get the tag name, instead of human unreadable tag id
    tag = TAGS.get(tag_id, tag_id)
    data = exifdata.get(tag_id)
    # decode bytes 
    if isinstance(data, bytes):
        data = data.decode()
    print(f"{tag:25}: {data}")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #load #image #metadata #pil
ADD COMMENT
Topic
Name
9+2 =