Search
 
SCRIPT & CODE EXAMPLE
 

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}")
Comment

PREVIOUS NEXT
Code Example
Python :: install virtual environments_brew 
Python :: python argv 
Python :: or statement python 
Python :: python add one month to a date 
Python :: go to line in python 
Python :: how to clear dictionary in python 
Python :: python timeout exception 
Python :: google calendar Request had insufficient authentication scopes. 
Python :: fibonacci sequence in python 
Python :: python enum advanced 
Python :: automate boring stuff with python 
Python :: can you look for specific characters in python 
Python :: matplotlive y axis 
Python :: Python Selenium import WebElement 
Python :: python string cut to length 
Python :: Python Tkinter Button Widget 
Python :: password guessing game python 
Python :: modulo python 
Python :: python array looping 
Python :: start process python 
Python :: discord bot python time delay 
Python :: reversed function python 
Python :: tkinter responsive gui 
Python :: how to get the max of a list in python 
Python :: python argument parser default value 
Python :: for loop get rid of stop words python 
Python :: np.eye 
Python :: python object of type set is not json serializable 
Python :: combine dictionaries, values to list 
Python :: django create superuser from script 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =