如何在Android中获取捕获图像中的详细信息

时间:2011-08-10 06:01:15

标签: android android-camera

我想知道如何从捕获的图像中获取图像细节。像纬度和经度和标题。我的程序捕获图像我希望将其详细信息编入程序。

2 个答案:

答案 0 :(得分:4)

要获取图像详细信息,请使用:

final ExifInterface exif = new ExifInterface(imageUri.getPath());
final int rotation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION,
                                ExifInterface.ORIENTATION_NORMAL);
final String datestamp = exif.getAttribute(ExifInterface.TAG_GPS_DATESTAMP);
final String gpsLatitude = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE);
final String gpsLatitudeRef = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF);
...

答案 1 :(得分:2)

使用ExifInterface,您可以获取拍摄图像的属性,前提是您的相机已配置为将其写入

相关问题