You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Johan Gustafsson (JIRA)" <ji...@apache.org> on 2016/07/05 11:26:10 UTC

[jira] [Updated] (CB-11536) Retrieving image using PHOTOLIBRARY with set targetWidth/targetHeight does not always respect set width/height values.

     [ https://issues.apache.org/jira/browse/CB-11536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Gustafsson updated CB-11536:
----------------------------------
    Description: 
I am currently having issues with the cordova-plugin-camera on iOS. Sometimes when I open a picture from the phone gallery using PHOTOLIBRARY variable, allowEdit as true and have the targetWidth/targetHeight set it returns an incorrectly sized image.

In my current application I need all my pictures in a 1:1 ratio with the width/height set to 400. However, sometimes when the image is returned from getPicture one of the sizes are off. For example, the width might be 400px but the height is oddly enough set to 398. 

From what I have managed to deduce it can be caused when someone is editing/cropping the selected picture and the area of the cropping area is outside or bigger than the picture itself. So if someone is editing/cropping and have dragged the cropping area outside the boundaries of the image and is too quick to hit Choose before the cropping area has snapped back inside the image area the returned image is not correctly sized(this does not happen everytime but I was able to quite reliably reproduce it). Furthermore if the image is smaller than the set targetWidth/targetHeight(in my case, an image of size 400x300) the plugin will just return the image as is, this is understandable but maybe it could instead return a letterboxed/pillarboxed image of the correct size? 

  was:
I am currently having issues with the cordova-plugin-camera on iOS. Sometimes when I open a picture from the phone gallery using PHOTOLIBRARY variable, allowEdit as true and have the targetWidth/targetHeight set it returns an incorrectly sized image.

In my current application I need all my pictures in a 1:1 ratio with the width/height set to 400. However, sometimes when the image is returned from getPicture one of the sizes are off. For example, the width might be 400px but the height is oddly enough set to 398. 

From what I have managed to deduce it can be caused when someone is editing/cropping the selected picture and the area of the cropping area is outside or bigger than the picture itself. So if someone is editing/cropping and have dragged the cropping outside the boundaries of the image and is to quick to hit Choose before the cropping area has snapped back inside the image area the returned image is not correctly sized(this does not happen everytime but I was able to quite reliably reproduce it). Furthermore if the image is smaller than the set targetWidth/targetHeight(in my case, an image of size 400x300) the plugin will just return the image as is, this is understandable but maybe it could instead return a letterboxed/pillarboxed image of the correct size? 


> Retrieving image using PHOTOLIBRARY with set targetWidth/targetHeight does not always respect set width/height values.
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: CB-11536
>                 URL: https://issues.apache.org/jira/browse/CB-11536
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Camera
>         Environment: iOS
>            Reporter: Johan Gustafsson
>
> I am currently having issues with the cordova-plugin-camera on iOS. Sometimes when I open a picture from the phone gallery using PHOTOLIBRARY variable, allowEdit as true and have the targetWidth/targetHeight set it returns an incorrectly sized image.
> In my current application I need all my pictures in a 1:1 ratio with the width/height set to 400. However, sometimes when the image is returned from getPicture one of the sizes are off. For example, the width might be 400px but the height is oddly enough set to 398. 
> From what I have managed to deduce it can be caused when someone is editing/cropping the selected picture and the area of the cropping area is outside or bigger than the picture itself. So if someone is editing/cropping and have dragged the cropping area outside the boundaries of the image and is too quick to hit Choose before the cropping area has snapped back inside the image area the returned image is not correctly sized(this does not happen everytime but I was able to quite reliably reproduce it). Furthermore if the image is smaller than the set targetWidth/targetHeight(in my case, an image of size 400x300) the plugin will just return the image as is, this is understandable but maybe it could instead return a letterboxed/pillarboxed image of the correct size? 



--
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