Part of an application that I am developing, has to obtain the metadata of the images for its later use in it, until now what I am using is ExifInterface , with something similar to the following:
//..
String filename = "DirectorioDondeEstaElFichero/DSC_.JPG";
try {
ExifInterface exif = new ExifInterface(filename);
FiltroExif(exif);
//ShowExif(exif);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//..
}
//..
private void FiltroExif(ExifInterface exif){
String attr="attr ---\n";
attr += getTagString(ExifInterface.TAG_DATETIME, exif);
attr += getTagString(ExifInterface.TAG_GPS_LATITUDE, exif);
attr += getTagString(ExifInterface.TAG_GPS_LATITUDE_REF, exif);
}
//..
But as the documentation says at some point:
This is a class for reading and writing Exif tags in a JPEG file.
There is some known way to read the metadata of an image PNG
should be possible without using any library not provided by andorid, although this is not a requirement , I would also be better if it were not provided by android.
This is commented on if someone has done something similar or helps you provide some solution:
As a last option it would be to review the SKIA code and try to do something there "although if possible I do not know if that would be messing hands at least in my case "
UPDATE :
- I do not need to write metadata on the image just to read it.
- To be an external library that has time to be created or used, to avoid bugs that may appear in the process of using it (but it is not a requirement).
- It would also be appreciated an example of use of the same or link to some type of documentation that indicates that it works for the propocito (but it is not a requirement).