Hey guys …
I am encountering some problem with Cordova Camera plugin and Android.
When taking picture in Android (e.g. in portrait mode) the image is rotated by -90° …
With the same code in iOS all works fine and have the correct orientation.
Someone has already had experience on this probem?
Basically this means that if images are not rotated correctly, you have to lower the width and height parameters so that the whole picture fits in memory. My local tests show that 8 mp resolution fails on S4, while 3 mp works fine.
Is there a fix for this, Users for my app are reporting this. But only users using a samsung variant. Any idea what the problem might be and we are yet to test.
I’ve been searching all over the web for this issue. It goes pretty deep it seems.
I see people talking about Android stripping EXIF info so the webview doesn’t know the pic is rotated, most issues should be resolved according to blogs, issuetrackers and stack overflow questions.
However, I am still experiencing this issue as well!
I tried playing around with the settings (bigger / smaller target sizes, enable / disable the fixOrientation, save to album option, etc) but it ALWAYS remains rotated -90 when the picture is taking portrait mode.
I even tried to read the EXIF data myself using a plugin, but it returns “undefined”. Probably because android strips it.
I had this issue on my Samsung Galaxy S5 (which allows up to 16MB images) and had to use encodingType: Camera.EncodingType.JPEG instead of PNG
along with the targetWidth: 720 in order avoid the wrong orientation issue.
Got the same issue on Galaxy S3. It works correctly only with 800 x 600 dimensions. @thlassche, how do you think, is there any possibility to fix that?
@thlassche, thanks. I’v just updated to the latest dev version of the cordova’s camera plugin (cordova plugin add https://github.com/apache/cordova-plugin-camera) and found out that the issue is no more for me. Seems like correctOrientation: true works as expected now.
Can you please confirm this regarding to your devices?
I did this, and I’m on 0.3.5 of the camera plugin, still no joy. tried this on Note 4 and Xperia Z Ultra, doesnt work. Strange enough, works fine on my nexus 5. Anyone any suggestions please?