My requirement is to extract a thumbnail in exif section in a jpeg file.
I have tried exiftool(http://www.sno.phy.queensu.ca/~phil/exiftool/).Exiftool is based on perl,this tool is very powerful and so it's also very very complex.I just want to extract the thumbnail!
After inverstaging, I think the library,exif.py, is prefer.
I followed the belowing to install the package.
1. download library at http://sourceforge.net/projects/exif-py/files/
2. extract it
3. I copied exif.py to Lib folder
Now I'll extact thumbnail. the belowing is a demo.
import EXIF
# extract thumbnail in Exif and save it
f = open("c://p2.jpg",'rb')
tags = EXIF.process_file(f)
# save the thumbnail into a jpg format file
f = open("c://a.jpg",'wb')
f.write(tags["JPEGThumbnail"])
f.close()

本文介绍了一种从JPEG文件的EXIF部分提取缩略图的方法。作者使用了exif.py库来实现这一目标,并提供了安装及使用的详细步骤。

1265

被折叠的 条评论
为什么被折叠?



