在谷歌應用程序引擎開發環境中,我無法獲取exif數據。我跟着嚮導從這裏 https://developers.google.com/appengine/docs/python/images/imageclass谷歌應用程序引擎中的圖像exif數據
我做的代碼
def getResizedImage(self, image, imagemaxWidth, imagemaxHeight):
img = images.Image(image_data=image)
logging.error(img.get_original_metadata())
我只得到無以下。 img對象沒問題,因爲我可以執行img.resize等。我需要獲取Exif信息。
更新:通過這樣做,我能得到的元數據,
def getResizedImage(self, image, imagemaxWidth, imagemaxHeight):
img = images.Image(image_data=image)
img.rotate(0)
img.execute_transforms()
logging.error(img.get_original_metadata())
像文檔說明我得到了很「有限」設置更準確地說這
{u'ImageLength': 480, u'ImageWidth': 640}
顯然,你得到多少在真實環境中更大的集合,我不知道爲什麼這不能成爲開發環境的特點。這很令人沮喪。只要我能得到pyexiv2級別的exif,我沒關係,但如果它只是使用PIL,那就不夠好。目前PIL提供了一些exif信息。
所以也沒有在生產中使用PIL,那是一種解脫。 PIL在閱讀EXIF方面嚴重打擊。 – specialscope