You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Scott Bradshaw (JIRA)" <ji...@apache.org> on 2016/03/19 05:24:33 UTC

[jira] [Commented] (CB-4078) correctOrientation is not working on camera.getPicture for PHOTOLIBRARY (works with Camera)

    [ https://issues.apache.org/jira/browse/CB-4078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15202557#comment-15202557 ] 

Scott Bradshaw commented on CB-4078:
------------------------------------

I was able to reproduce this issue today and spent hours trying to figure out what's going on. 

The problem is easy to reproduce. On Android 4.4+ devices, the PHOTOLIBRARY option won't return the photo rotated. When ACTION_GET_CONTENT Intent is used, as opposed to ACTION_PICK on KitKat, the new Documents Activity is shown to allow the user to choose an image. Once an image is selected, the plugin trys to query for Images.Media.ORIENTATION directly on the documents uri, but that always returns 0. The fix is fairly simple; you first extract the id out and use it on the MediaStore, and then the query returns the correct orientation.

I corrected this locally with a custom camera plugin I'm working on to do face detection. I'll see if I can fork the official plugin to fix it and do a pull request. 

> correctOrientation is not working on camera.getPicture for PHOTOLIBRARY (works with Camera)
> -------------------------------------------------------------------------------------------
>
>                 Key: CB-4078
>                 URL: https://issues.apache.org/jira/browse/CB-4078
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Camera
>    Affects Versions: 2.9.0
>         Environment: Android
>            Reporter: aligo
>            Priority: Minor
>              Labels: Android, Triaged
>
> Hi
> I use cameraOptions below to get the FILE_URI and to display in <img> tag:
> {code}
>       correctOrientation: true
>       quality: 50
>       encodingType: Camera.EncodingType.JPEG
>       targetWidth: 300
>       targetHeight: 300
>       destinationType: window.navigator.camera.DestinationType.FILE_URI
>       sourceType: window.navigator.camera.PictureSourceType.PHOTOLIBRARY
> {code}
> But the picture displayed within wrong orientation.
> Updated:
> I try use window.navigator.camera.PictureSourceType.CAMERA in sourceType, and everything work as expected.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org