Last modified: 2012-07-26 23:57:31 UTC
Were currently not reading it at all causing images to NOT be rotated in the app. Upon upload MW handles it correctly and rotates the image.MW handles this correctly and so should we.
In theory we could steal the JS code from Special:Upload/UploadWizard but I don't think we can read binary files currently. It'll probably be easiest to throw in a Cordova plugin to extract the data and return it to JS, can probably grab an existing Java library to do the exif stuff.
Well, according to http://docs.phonegap.com/en/1.9.0/cordova_camera_camera.md.html#Camera passing correctOrientation as a param should do this for us. I tried, and it does nothing :(
So with a 8MP camera the images are 3264x2448 with these options: { quality: 100, destinationType: navigator.camera.DestinationType.FILE_URI, sourceType: source, encodingType: navigator.camera.EncodingType.JPEG, correctOrientation: true } This means the image in memory is about 31 megabytes and then the secondary image to hold the rotation data is another 31 megabytes. This can cause an, "out of memory error". I think they'll need to write their own image manipulation code to get around this issue.
This is also a good reference: https://developer.android.com/reference/android/media/ExifInterface.html
I don't really see any issue with this, specifically the getOrientation method on line 166: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=blob;f=framework/src/org/apache/cordova/ExifHelper.java;hb=231b39d2#l166
This is fixed!
This should be fixed in the migration to: https://github.com/wikimedia/incubator-cordova-android/commit/9de1f29546c5d1c332bd46c67ed66bfc04cc134f
https://github.com/wikimedia/incubator-cordova-android/commit/9de1f29546c5d1c332bd46c67ed66bfc04cc134f