Last modified: 2012-07-26 23:57:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T40344, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38344 - Respect EXIF rotation of images in app
Respect EXIF rotation of images in app
Status: RESOLVED FIXED
Product: WikiLoves Monuments Mobile
Classification: Unclassified
Upload (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Brion Vibber
:
Depends on:
Blocks: 37577
  Show dependency treegraph
 
Reported: 2012-07-11 21:07 UTC by Tomasz Finc
Modified: 2012-07-26 23:57 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tomasz Finc 2012-07-11 21:07:25 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.
Comment 1 Brion Vibber 2012-07-12 16:46:31 UTC
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.
Comment 2 Yuvi Panda 2012-07-17 19:14:03 UTC
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 :(
Comment 3 Patrick Reilly 2012-07-24 19:33:31 UTC
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.
Comment 4 Patrick Reilly 2012-07-24 19:34:44 UTC
This is also a good reference: https://developer.android.com/reference/android/media/ExifInterface.html
Comment 5 Patrick Reilly 2012-07-24 19:37:36 UTC
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
Comment 6 Jon 2012-07-26 23:11:18 UTC
This is fixed!
Comment 7 Patrick Reilly 2012-07-26 23:56:52 UTC
This should be fixed in the migration to: https://github.com/wikimedia/incubator-cordova-android/commit/9de1f29546c5d1c332bd46c67ed66bfc04cc134f

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links