In Android 2.2 is there a way to rotate a photograph without losing the Exif and other metadata? I tried using the Matrix class but it drops the metadata.
Asked
Active
Viewed 1,323 times
2 Answers
3
You could read the EXIF data, rotate the image, and then write the EXIF data. ExifInterface has been available since API 5. I found an example of writing exif here: Android write EXIF GPS Latitude and Longitude onto JPEG failed
1
Based on my research (Nov 2012), there is no way to preserve the exif metadata automatically if you resize the image (or otherwise process it via the Bitmap* classes).
You must specifically retrieve and copy the exif properties by name. This blog post was very helpful:
http://vikaskanani.wordpress.com/2011/07/17/android-re-size-image-without-loosing-exif-information/
And I wrote up my own experience here:
Android Image Resizing and Preserving EXIF data (Orientation, Rotation, etc)

Community
- 1
- 1

Mike Repass
- 6,825
- 5
- 38
- 35