2

I'm writing an app where I'd like to add the direction of the camera view to the image taken. I've seen the android.media.ExifInterface class, but it looks limited to only a few fields.

The exif 'standard' defines GPSImgDirection and GPSDestBearing which look like the ones I want, but they're not defined with the ExifInterface class.

Is there any way of applying them to an image (with or without ExifInterface)? I'm prepared to write my own jpeg header parsing, but would really like to avoid it if possible.

6
  • 1
    did you try use "GPSImgDirection" string instead of static string from ExifInterface when you using getAttribute(String tag)? getAttribute("GPSImgDirection") ?
    – Selvin
    Commented Nov 8, 2011 at 14:08
  • No, but I should at least try it. I assumed that since the docs defined the string values it wouldn't accept anything else...
    – Mush
    Commented Nov 8, 2011 at 16:28
  • ok, tried it and it doesn't throw an error but it won't save the attribute. Looking at the source of ExifInterface shows that it's just doing its defined tags and ignoring anything else. I wonder if I can extend that class with my definitions though...
    – Mush
    Commented Nov 8, 2011 at 17:01
  • So the only possibility is to fine java exif implementation, port it to android(maybe there is one allready ported) and use it
    – Selvin
    Commented Nov 8, 2011 at 17:26
  • extending almost worked - could write the attribute (although value looks odd), but can't read it. Could be close though.
    – Mush
    Commented Nov 8, 2011 at 17:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.