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

Commit b0a4294

Browse files
author
Jamie Halmick
committed
Fix iOS image_picker plugin to use 70% quality for JPEG files
1 parent 9051673 commit b0a4294

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/image_picker/ios/Classes/FLTImagePickerMetaDataUtil.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ + (NSData *)convertImage:(UIImage *)image
6969

7070
switch (type) {
7171
case FLTImagePickerMIMETypeJPEG: {
72-
CGFloat qualityFloat = quality ? quality.floatValue : 1;
72+
CGFloat qualityFloat = quality ? quality.floatValue : 0.7; // Jamie Halmick - hardcoded to 70% instead of 100% quality to save size
7373
return UIImageJPEGRepresentation(image, qualityFloat);
7474
}
7575
case FLTImagePickerMIMETypePNG:
7676
return UIImagePNGRepresentation(image);
7777
default: {
7878
// converts to JPEG by default.
79-
CGFloat qualityFloat = quality ? quality.floatValue : 1;
79+
CGFloat qualityFloat = quality ? quality.floatValue : 0.7; // Jamie Halmick - hardcoded to 70% instead of 100% quality to save size
8080
return UIImageJPEGRepresentation(image, qualityFloat);
8181
}
8282
}

0 commit comments

Comments
 (0)