Skip to content

Commit

Permalink
fix: get correct image dimensions for ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Elena Hristova committed Nov 8, 2018
1 parent c1c7c12 commit 3c2df04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/camera.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ class UIImagePickerControllerDelegateImpl extends NSObject implements UIImagePic

private setImageAssetAndCallCallback(imageAsset: imageAssetModule.ImageAsset) {
if (this._keepAspectRatio) {
let isPictureLandscape = imageAsset.nativeImage.size.width > imageAsset.nativeImage.size.height;
let pictureWidth = imageAsset.nativeImage ? imageAsset.nativeImage.size.width : imageAsset.ios.pixelWidth;
let pictureHeight = imageAsset.nativeImage ? imageAsset.nativeImage.size.height : imageAsset.ios.pixelHeight;
let isPictureLandscape = pictureWidth > pictureHeight;
let areOptionsLandscape = this._width > this._height;
if (isPictureLandscape !== areOptionsLandscape) {
let oldWidth = this._width;
Expand Down

0 comments on commit 3c2df04

Please sign in to comment.