Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android : Exif of a Byte[] or Bitmap object

Is it possible to read the Exif header of a Byte[] or Bitmap object without write it on the disk? I only found one constructor ExifInterface(String filename), and it doesn't seem possible to do that. Could you please confirm?

Otherwise, how could I save that bitmap on the cache directory and take it back in order to read the Exif header?

like image 370
Denis Avatar asked Sep 25 '22 05:09

Denis


1 Answers

You could use my metadata-extractor library. It has classes that'll decode Exif (and other formats) from byte[], streams, files...

Something like this should work:

Metadata metadata = new Metadata();
new ImageMetadataReader().extract(new ByteArrayReader(bytes), metadata);

Now you can inspect the Metadata object.

The lib is available via Maven.

like image 157
Drew Noakes Avatar answered Oct 20 '22 09:10

Drew Noakes