diff --git a/packages/image_picker/CHANGELOG.md b/packages/image_picker/CHANGELOG.md index 78d44e594eb5..bde2b7a41d0c 100644 --- a/packages/image_picker/CHANGELOG.md +++ b/packages/image_picker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.1+5 + +* Fix aspect ratio inversion on images that was rotated side ways(Left, Right, etc.). + ## 0.6.1+4 * Android: Fix a regression where the `retrieveLostImage` does not work anymore. diff --git a/packages/image_picker/ios/Classes/FLTImagePickerImageUtil.m b/packages/image_picker/ios/Classes/FLTImagePickerImageUtil.m index 000bd4bf9c66..00a2d87d75ee 100644 --- a/packages/image_picker/ios/Classes/FLTImagePickerImageUtil.m +++ b/packages/image_picker/ios/Classes/FLTImagePickerImageUtil.m @@ -68,10 +68,17 @@ + (UIImage *)scaledImage:(UIImage *)image } } } - // Scaling the image always rotate itself based on the current imageOrientation of the original // Image. Set to orientationUp for the orignal image before scaling, so the scaled image doesn't // mess up with the pixels. + if (image.imageOrientation == UIImageOrientationRight || + image.imageOrientation == UIImageOrientationLeft || + image.imageOrientation == UIImageOrientationLeftMirrored || + image.imageOrientation == UIImageOrientationRightMirrored) { + double heightCopy = height; + height = width; + width = heightCopy; + } UIImage *imageToScale = [UIImage imageWithCGImage:image.CGImage scale:1 orientation:UIImageOrientationUp]; diff --git a/packages/image_picker/pubspec.yaml b/packages/image_picker/pubspec.yaml index c5d1647bb410..ad09895d9445 100755 --- a/packages/image_picker/pubspec.yaml +++ b/packages/image_picker/pubspec.yaml @@ -5,7 +5,7 @@ authors: - Flutter Team - Rhodes Davis Jr. homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker -version: 0.6.1+4 +version: 0.6.1+5 flutter: plugin: