我想在android中读取图像中的exif信息。我可以在图库中读取exif图像,但是我无法读取从相机拍摄的exif照片 [英] I want to read exif info in image in android. I can read exif from image in gallery but i cannot read exif photo taken from the camera
本文介绍了我想在android中读取图像中的exif信息。我可以在图库中读取exif图像,但是我无法读取从相机拍摄的exif照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如上图所示。我选择了拍摄图片的exif信息为null。我选择了来自手机选项的图像,并且exif信息不为空。 使用android api无法从Stream读取Exif数据。 ExifInterface没有带InputStream的构造函数。
但是,您可以使用元数据提取器
,并使用InputStream构造函数使用ByteArrayInputStream构建一个由您的byte []支持的InputStream。
As shown in the figure above.I chose the take a picture exif information is null. I chose image from phone option and exif information is not null.
解决方案
You cannot read exif data from a Stream using the android api. ExifInterface doesn't have a constructor with an InputStream.
However, You can use the metadata-extractor and use the constructor with an InputStream to build an InputStream backed by your byte[] using a ByteArrayInputStream
这篇关于我想在android中读取图像中的exif信息。我可以在图库中读取exif图像,但是我无法读取从相机拍摄的exif照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文