2

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.

fishjd
  • 1,617
  • 1
  • 18
  • 31

2 Answers2

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

Community
  • 1
  • 1
Frohnzie
  • 3,559
  • 1
  • 21
  • 24
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