I have an app that captures photos using the native Camera
and then uploads them to a server. My problem is that all the photos have an EXIF orientation value of 0,
Turns out my code was able to set the EXIF data, but there is a discrepancy between how Android interprets this data and how iOS and Chrome on a Mac (where I was checking the resulting file) interprets it.
This is the only code needed to set EXIF orientation:
ExifInterface exif = new ExifInterface(pictureFile.toString());
exif.setAttribute(ExifInterface.TAG_ORIENTATION, "3");
exif.saveAttributes();
However, setting 3
shows up as 0
on iOS and the image is sideways in Chrome.
setting 6
shows up as 3
on iOS and the image looks right in Chrome.