检索保存到Blobstore的照片的元数据
问题描述:
我使用plupload将照片上传到Blobstore。该BlobInfo object有一些元数据检索保存到Blobstore的照片的元数据
content_type: The content type of the blob.
creation: The creation date of the blob, or when it was uploaded.
filename: The file name that the user selected from their machine.
size: The size of the uncompressed blob.
md5_hash: The MD5 hash value of the uploaded blob.
我的问题是怎样才能得到照片的其他元数据无论是从plupload或服务器端?具体来说,我需要检索一个“description”元数据字段。
答
我会用exif-py如下:
blob_reader = blobstore.BlobReader(blob_key)
blob_reader_data = StringIO.StringIO(blob_reader.read())
tags = exifread.process_file(blob_reader_data)
标签对象返回包含你正在寻找的元数据。