Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Prev Previous commit
Next Next commit
update annotation
  • Loading branch information
owops committed Oct 15, 2019
commit 9e37930480a03f6ffd72ddc97949675b49bc1b20
8 changes: 5 additions & 3 deletions packages/image_picker/ios/Classes/FLTImagePickerImageUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ + (UIImage *)scaledImage:(UIImage *)image
scale:1
orientation:UIImageOrientationUp];

// Swap width and height when source image orientation is left/right
// In order to avoid the problem of error width/height when image
// orientation in these enums.
// The image orientation is manually set to UIImageOrientationUp which swapped the aspect ratio in some scenarios.
// For example, when the original image has orientation left, the horizontal pixels
// should be scaled to `width` and the vertical pixels should be scaled to `height`. After setting the orientation
// to up, we end up scaling the horizontal pixels to `height` and vertical to `width`.
// Below swap will solve this issue.
if ([image imageOrientation] == UIImageOrientationLeft ||
[image imageOrientation] == UIImageOrientationRight ||
[image imageOrientation] == UIImageOrientationLeftMirrored ||
Expand Down