mirror of
https://gitee.com/shuto/cordova-imagePicker.git
synced 2026-04-16 00:02:54 +08:00
Simplified full size image logic to take full size whenever height and width are each 0 (the default)
This commit is contained in:
@@ -20,6 +20,5 @@
|
||||
@property (nonatomic, assign) NSInteger width;
|
||||
@property (nonatomic, assign) NSInteger height;
|
||||
@property (nonatomic, assign) NSInteger quality;
|
||||
@property (nonatomic, assign) bool fullSizeImage;
|
||||
|
||||
@end
|
||||
|
||||
+1
-2
@@ -22,7 +22,6 @@
|
||||
NSDictionary *options = [command.arguments objectAtIndex: 0];
|
||||
|
||||
NSInteger maximumImagesCount = [[options objectForKey:@"maximumImagesCount"] integerValue];
|
||||
self.fullSizeImage = [[options objectForKey:@"fullSizeImage"] boolValue];
|
||||
self.width = [[options objectForKey:@"width"] integerValue];
|
||||
self.height = [[options objectForKey:@"height"] integerValue];
|
||||
self.quality = [[options objectForKey:@"quality"] integerValue];
|
||||
@@ -62,7 +61,7 @@
|
||||
image = [dict objectForKey:UIImagePickerControllerOriginalImage];
|
||||
|
||||
NSData* data = nil;
|
||||
if (self.fullSizeImage == YES) {
|
||||
if (self.width == 0 && self.height == 0) {
|
||||
data = UIImageJPEGRepresentation(image, self.quality/100.0f);
|
||||
} else {
|
||||
CGSize targetSize = CGSizeMake(self.width, self.height);
|
||||
|
||||
Reference in New Issue
Block a user