简体   繁体   English

我想在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

范例图片

As shown in the figure above.I chose the take a picture exif information is null. 如上图所示。我选择拍照exif信息为null。 I chose image from phone option and exif information is not null. 我从电话选项中选择了图像,并且exif信息不为null。

You cannot read exif data from a Stream using the android api. 您无法使用android API从Stream中读取exif数据。 ExifInterface doesn't have a constructor with an InputStream. ExifInterface没有带有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 但是,您可以使用元数据提取器 ,并将构造函数与InputStream一起使用,以使用ByteArrayInputStream构建由byte []支持的InputStream。

It is now possible to read EXIF data from streams through the ExifInterface Support Library. 现在可以通过ExifInterface支持库从流中读取EXIF数据。

compile "com.android.support:exifinterface:25.1.0"

Source: https://android-developers.googleblog.com/2016/12/introducing-the-exifinterface-support-library.html 来源: https//android-developers.googleblog.com/2016/12/introducing-the-exifinterface-support-library.html

Android API do not read EXIF from Stream . Android API不会从Stream读取EXIF。

Check this one - https://stackoverflow.com/a/12952370/842607 选中一个-https://stackoverflow.com/a/12952370/842607

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android EXIF数据相机或图库中的图像丢失 - Android EXIF data Image from Camera or Gallery lost Xamarin Android 无法从旋转图像中读取 EXIF 数据以检查图像是否旋转 - Xamarin Android can't read EXIF data from the rotated image to check whether the image rotated or not 从相机拍摄的图像的GEO Exif信息为空 - GEO Exif informations of image taken from camera are null 从onActivityResult中的图库图像中检索EXIF数据 - Retrieve EXIF data from gallery image in onActivityResult 从图库Orientation中选择的Android图像始终为0:Exif TAG - Android image selected from gallery Orientation is always 0 : Exif TAG Cordova 3.6:如何从Android的照片库中提取GPS Exif数据? - Cordova 3.6: how can I extract GPS Exif data from photo library in Android? 从照片的EXIF数据中读取地理坐标 - Read Geo Coordinates from EXIF data of Photos 如何从Android Camera图像中剥离EXIF数据 - How to strip EXIF data from Android Camera image 如何编辑我的图像 EXIF 数据以进行图像旋转 - How can I edit My image EXIF data for image rotation Android 11 从 EXIF 获取图像方向 - Android 11 get image orientation from EXIF
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM