23 lines
430 B
Python
23 lines
430 B
Python
from PIL import Image, ExifTags
|
|
import sys
|
|
|
|
|
|
def main(fname):
|
|
img = Image.open(fname)
|
|
|
|
width, height = img.size
|
|
|
|
print("Width: %dpx" % width)
|
|
print("Height: %dpx" % height)
|
|
print("Format: %s" % img.format)
|
|
|
|
tags = img._getexif()
|
|
|
|
for tag, value in tags.items():
|
|
decoded = ExifTags.TAGS.get(tag, tag)
|
|
print("%s: %s" % (decoded, value))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main(sys.argv[1])
|