问题
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