mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2025-01-19 03:35:10 +08:00
CB-6190 - iOS camera plugin ignores quality parameter
CB-6190 - iOS camera plugin ignores quality parameter in some circunstances Added a check to not downscale if quality is 100 or sourceType != UIImagePickerControllerSourceTypeCamera (according to the docs, images from gallery aren’t downscaled). This closes #108
This commit is contained in:
parent
837d6721f2
commit
b8a68af63f
@ -346,7 +346,7 @@ static NSString* toBase64(NSData* data) {
|
||||
break;
|
||||
case EncodingTypeJPEG:
|
||||
{
|
||||
if ((options.allowsEditing == NO) && (options.targetSize.width <= 0) && (options.targetSize.height <= 0) && (options.correctOrientation == NO)){
|
||||
if ((options.allowsEditing == NO) && (options.targetSize.width <= 0) && (options.targetSize.height <= 0) && (options.correctOrientation == NO) && (([options.quality integerValue] == 100) || (options.sourceType != UIImagePickerControllerSourceTypeCamera))){
|
||||
// use image unedited as requested , don't resize
|
||||
data = UIImageJPEGRepresentation(image, 1.0);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user