cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier VERMONT (JIRA)" <>
Subject [jira] [Commented] (CB-8913) [Windows] Camera picture can be out of shape when resized
Date Sat, 17 Oct 2015 16:21:05 GMT


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) :
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:
>             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
(calculateAspectRatio) inside Android version of Camera plugin.

This message was sent by Atlassian JIRA

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

View raw message