In google app engine dev environment I cannot get exif data. I followed guide from here https://developers.google.com/appengine/docs/python/images/imageclass
I have done following in the code
def getResizedImage(self, image, imagemaxWidth, imagemaxHeight):
img = images.Image(image_data=image)
logging.error(img.get_original_metadata())
I only get None. the img object is fine as I can perform img.resize etc. I need to get Exif info.
UPDATE: By doing this I was able to get metadata,
def getResizedImage(self, image, imagemaxWidth, imagemaxHeight):
img = images.Image(image_data=image)
img.rotate(0)
img.execute_transforms()
logging.error(img.get_original_metadata())
Like explained in documentation I got very 'limited' set more precisely this
{u'ImageLength': 480, u'ImageWidth': 640}
Apparently you get much bigger set in real environment, I have no idea why this cant be the feature of dev env though. It is quite frustrating. As long as I can get pyexiv2 level exif I am okay but if it is just using PIL that is not good enough. Currently PIL provides way little exif information.
The dev environment uses PIL which explains what you see. The production environment does not use PIL and will give you the majority of the tags that are in the image.
Taken from the docs for
get_original_metadata
You want to pass
parse_metadata=True
toexecute_transform
in order to get more metadata including the exif data.Also The bottom note about it returning
None
explains why you had to callexecute_transforms
in order to get anything back