Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

_getexif

from PIL import Image, ExifTags

img = Image.open("sample.jpg")
img_exif = img.getexif()
print(type(img_exif))
# <class 'PIL.Image.Exif'>

if img_exif is None:
    print('Sorry, image has no exif data.')
else:
    for key, val in img_exif.items():
        if key in ExifTags.TAGS:
            print(f'{ExifTags.TAGS[key]}:{val}')
            # ExifVersion:b'0230'
            # ...
            # FocalLength:(2300, 100)
            # ColorSpace:1
            # ...
            # Model:'X-T2'
            # Make:'FUJIFILM'
            # LensSpecification:(18.0, 55.0, 2.8, 4.0)
            # ...
            # DateTime:'2019:12:01 21:30:07'
            # ...
Comment

PREVIOUS NEXT
Code Example
Python :: Python Print Variable Using the string formatting with positional arguments {} 
Python :: assert in python 
Python :: sys module in python 
Python :: how to check if object is of file type in python3 
Python :: Python Tuples Tuples allow duplicate values 
Python :: python script for downloading files from googledrive 
Python :: python linux command 
Python :: numpy combine two arrays selecting min 
Python :: pytonh leer txt y quitar tildes acentos 
Python :: add prefix to names in directory python 
Python :: chrome detach selenium python 
Python :: Mac: Access your iCloud Documents folder with Jupyter Notebook or JupyterLab 
Python :: pytorch dataloader to device 
Python :: get admin url of instance django 
Python :: pairwise combinations groupby 
Python :: Chef in his Office codechef solution 
Python :: seaborn boxplot (both categorical and numeric data) 
Python :: python remove last part of string 
Python :: splitting on basis of regex python 
Python :: python cv2 unblur 
Python :: python string name out of mail 
Python :: dobj in spacy 
Python :: inverse box-cox transformation python 
Python :: python append to a exiting csv file 
Python :: python json change line 
Python :: python get focused window 
Python :: how to split a dataframe into train and test 
Python :: Fibonacci series up to n python 
Python :: how to connect ip camera to opencv python 
Python :: Sorting a list using a named function 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =