mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-30 15:31:10 +00:00
23 lines
426 B
Python
23 lines
426 B
Python
|
from PIL import Image
|
||
|
from PIL.ExifTags import TAGS
|
||
|
import sys
|
||
|
|
||
|
arg = sys.argv[1]
|
||
|
if arg == "":
|
||
|
print("Please give a valid image path")
|
||
|
quit()
|
||
|
|
||
|
image = Image.open(arg)
|
||
|
exifdata = image.getexif()
|
||
|
|
||
|
if len(exifdata) <= 0:
|
||
|
print("No metadata found for this image")
|
||
|
quit()
|
||
|
|
||
|
for tag_id in exifdata:
|
||
|
|
||
|
tagname = TAGS.get(tag_id, tag_id)
|
||
|
value = exifdata.get(tag_id)
|
||
|
|
||
|
print(f"{tagname:25}: {value}")
|