Skip to content

Commit

Permalink
Merge pull request #138 from NativeScript/hristova/fix-getting-image-…
Browse files Browse the repository at this point in the history
…dimensions-in-ios

fix: get correct image dimensions for ios
  • Loading branch information
elena-p authored Nov 8, 2018
2 parents c1c7c12 + 3c2df04 commit 9e780bc
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 9e780bc

Please sign in to comment.