0

i'm working on a python script that extracts exif data from png files although i ran into an error i don't know to fix, the error i get: AttributeError: 'PngImageFile' object has no attribute '_getexif'

#! /usr/bin/env python

from PIL import Image
from PIL.ExifTags import TAGS
import sys

if len(sys.argv) == 1:
    print "Usage: %s <image file>" % sys.argv[0]
else:
    image = sys.argv[1]
    for (tag, value) in Image.open(image)._getexif().iteritems():
        print "%s = %s" %(TAGS.get(tag), value)

Any help appreciated :)

Anciety
  • 85
  • 2
  • 10
  • Check out https://github.com/smarnach/pyexiftool – Quentin 2 Aug 12 '18 at 11:14
  • As a general rule, PNG images don't contain EXIF data... http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=7988.0 Do you have some reason to believe that yours does? And that PIL can read it? Have you tried accessing it via `exiftool`? – Mark Setchell Aug 12 '18 at 16:40
  • Oh well i thought that instead png images do not contain EXIF data they did so it's more of a miscommunication – Anciety Aug 12 '18 at 19:02

0 Answers0