android提供了读取写入exif的api,但很可惜,这个api只能由指定文件名读取、写入exif,效率低得可怜。
不得已,把android系统代码里图库的一段摘了过来。
有android源码的看源码中 packages/apps/gallery2/ 部分,
没有或者图方便的直接看这里:
<a href="https://github.com/jxt1234/thirdpartyusefulcode/tree/master/android_app/exif">https://github.com/jxt1234/thirdpartyusefulcode/tree/master/android_app/exif</a>
和sdk中那个api用法基本一致,可参考:
<a href="http://www.cnblogs.com/hyzhou/p/3336812.html">http://www.cnblogs.com/hyzhou/p/3336812.html</a>
不过这个exif库支持从内存、流之中直接读取写入,方便很多。
用到的接口只有
exifinterface
其中读取和写入的接口支持内存/流。
readexif 读取
writeexif 写入
其他用法一样。
读取exif中的缩略图示例
写入: