Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[image_picker] Fix rotation when camera is a source #4019

Merged
merged 3 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/image_picker/image_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.8.0+2

* Fix a rotation problem where when camera is chosen as a source and additional parameters are added.

## 0.8.0+1

* Removed redundant request for camera permissions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ - (void)testScaledImage_ShouldBeScaledWithNoMetadata {
XCTAssertEqual(newImage.size.height, 2);
}

- (void)testScaledImage_ShouldBeCorrectRotation {
UIImage *image = [UIImage imageWithData:ImagePickerTestImages.JPGTestData];
UIImage *newImage = [FLTImagePickerImageUtil scaledImage:image
maxWidth:@3
maxHeight:@2
isMetadataAvailable:YES];

XCTAssertEqual(newImage.imageOrientation, UIImageOrientationUp);
}

- (void)testScaledGIFImage_ShouldBeScaled {
// gif image that frame size is 3 and the duration is 1 second.
GIFInfo *info = [FLTImagePickerImageUtil scaledGIFImage:ImagePickerTestImages.GIFTestData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ - (void)imagePickerController:(UIImagePickerController *)picker
image = [FLTImagePickerImageUtil scaledImage:image
maxWidth:maxWidth
maxHeight:maxHeight
isMetadataAvailable:originalAsset != nil];
isMetadataAvailable:YES];
}

if (!originalAsset) {
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for selecting images from the Android and iOS image
library, and taking new pictures with the camera.
repository: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
version: 0.8.0+1
version: 0.8.0+2

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down