cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Bradshaw (JIRA)" <>
Subject [jira] [Commented] (CB-4078) correctOrientation is not working on camera.getPicture for PHOTOLIBRARY (works with Camera)
Date Sat, 19 Mar 2016 04:24:33 GMT


Scott Bradshaw commented on CB-4078:

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

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:
>             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:
>       sourceType:
> {code}
> But the picture displayed within wrong orientation.
> Updated:
> I try use in sourceType, and everything
work as expected.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message