开发者

How to get Details in Captured image in Android

开发者 https://www.devze.com 2023-03-27 13:58 出处:网络
I want to know how to 开发者_StackOverflow中文版get image details from captured image. like latitude and longitude and title. My programme capture image I want to get its details to programme.To get i

I want to know how to 开发者_StackOverflow中文版get image details from captured image. like latitude and longitude and title. My programme capture image I want to get its details to programme.


To get image details use:

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);
...


Using ExifInterface you can get attributes of the captured image provided your camera was configured to write them

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号