【发布时间】:2012-06-28 14:49:21
【问题描述】:
在谷歌应用引擎开发环境中,我无法获取 exif 数据。我从这里跟随指南 https://developers.google.com/appengine/docs/python/images/imageclass
我已经在代码中完成了以下操作
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}
显然你在真实环境中得到了更大的设置,但我不知道为什么这不能成为 dev env 的特性。这很令人沮丧。只要我能获得 pyexiv2 级别的 exif 就可以了,但如果只是使用 PIL 就不够好。目前 PIL 提供的 exif 信息很少。
【问题讨论】:
标签: python google-app-engine exif