-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
p: image_pickerThe Image Picker plugin.The Image Picker plugin.packageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specificallywaiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
Image picker plugin cause error width and height in scaled images.
File imageFile = await ImagePicker.pickImage(
source: ImageSource.camera,
maxWidth: 800,
);image source pixel:
3024 × 4032
image scale result pixel:
1066 × 800
Reason:
In image picker plugin, use
UIImage *imageToScale = [UIImage imageWithCGImage:image.CGImage
scale:1
orientation:UIImageOrientationUp];to change Image rotation to UIImageOrientationUp
but forget to swap width/height result
if([image imageOrientation] == UIImageOrientationLeft
|| [image imageOrientation] == UIImageOrientationRight
|| [image imageOrientation] == UIImageOrientationLeftMirrored
|| [image imageOrientation] == UIImageOrientationRightMirrored) {
double temp = width;
width = height;
height = temp;
}these codes will fix this bug
pdefuns
Metadata
Metadata
Assignees
Labels
p: image_pickerThe Image Picker plugin.The Image Picker plugin.packageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specificallywaiting for PR to land (fixed)A fix is in flightA fix is in flight