How to get all details of an image pragmatically available in Android phone gallery

喜你入骨 提交于 2019-12-10 11:34:44

问题


I am trying to fetch all details (specially location) available with image in phone gallery.Those will come when user click on details. So please tell me how can i do this. Refer screenshots for better understanding. Thanks in advance


回答1:


you can use android's ExifInterface for doing this. This is a class for reading and writing Exif tags in a JPEG file or a RAW image file. Supported formats are: JPEG, DNG, CR2, NEF, NRW, ARW, RW2, ORF and RAF.

Refer it from here Android ExifInterface




回答2:


You can use this library which can get Metadata from any image type. Usage is pretty easy too. https://github.com/drewnoakes/metadata-extractor/




回答3:


You Should Go with ExifInterface class to read various EXIF metadata from Images:

Example :

ExifInterface exif = new ExifInterface(filepath_to_get_value_from);
exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE);
exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF);
exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE);
exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF);

To Convert this into Real Values this Blog look blog.



来源:https://stackoverflow.com/questions/41957475/how-to-get-all-details-of-an-image-pragmatically-available-in-android-phone-gall

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!