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

Olivier VERMONT commented on CB-8913:
-------------------------------------

There was a problem with ratio in version 4.1 of cordova-plugin-camera for 
windows, all pictures where square when you used both {{targetHeight}} and 
{{targetWidth}} with same value (which is usually what we do). Infact, in the 
code we had no ratio calculation :
{{var imageWidth = targetWidth, imageHeight = targetHeight;}}

I see that we now have this which should solve the issue (line 96 of 
CameraProxy.js) :
{quote}
var ratio = Math.min(targetWidth / this.width, targetHeight / this.height);
var imageWidth = ratio * this.width;
var imageHeight = ratio * this.height;{quote}

I do think we can consider the issue as solved but when will a new version be 
released so we don't have to use a hack in CameraProxy.js ?

> [Windows] Camera picture can be out of shape when resized
> ---------------------------------------------------------
>
>                 Key: CB-8913
>                 URL: https://issues.apache.org/jira/browse/CB-8913
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Plugin Camera
>    Affects Versions: 3.4.0
>            Reporter: Olivier VERMONT
>              Labels: camera, out_of_shape, ratio, resize
>
> When targetHeight and/or targetWidth are used, depending on 
> landscape/portrait mode, resulting picture can be completly out of shape. 
> There is something to do concerning aspect ratio as it is done in 
> CameraLauncher.java (calculateAspectRatio) inside Android version of Camera 
> plugin.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to