Skip to content

Commit

Permalink
separate variables on different lines
Browse files Browse the repository at this point in the history
  • Loading branch information
parveshneedhoo committed Nov 9, 2023
1 parent 4c94b93 commit ed1adbd
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/ios/SOSPicker.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,17 @@ - (void)assetsPickerController:(GMImagePickerController *)picker didFinishPickin
// no scaling required
if (self.outputType == BASE64_STRING){
UIImage* image = [UIImage imageNamed:item.image_fullsize];
NSDictionary *imageInfo = @{@"path":[UIImageJPEGRepresentation(image, self.quality/100.0f) base64EncodedStringWithOptions:0], @"width": [NSNumber numberWithFloat:image.size.width], @"height": [NSNumber numberWithFloat:image.size.height]};
NSDictionary *imageInfo = @{@"path":[UIImageJPEGRepresentation(image, self.quality/100.0f) base64EncodedStringWithOptions:0],
@"width": [NSNumber numberWithFloat:image.size.width],
@"height": [NSNumber numberWithFloat:image.size.height]};
[resultList addObject: imageInfo];
} else {
if (self.quality == 100) {
// no scaling, no downsampling, this is the fastest option
UIImage* image = [UIImage imageNamed:item.image_fullsize];
NSDictionary *imageInfo = @{@"path":item.image_fullsize, @"width": [NSNumber numberWithFloat:image.size.width], @"height": [NSNumber numberWithFloat:image.size.height]};
NSDictionary *imageInfo = @{@"path":item.image_fullsize,
@"width": [NSNumber numberWithFloat:image.size.width],
@"height": [NSNumber numberWithFloat:image.size.height]};
[resultList addObject: imageInfo];

} else {
Expand All @@ -224,7 +228,9 @@ - (void)assetsPickerController:(GMImagePickerController *)picker didFinishPickin
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[err localizedDescription]];
break;
} else {
NSDictionary *imageInfo = @{@"path":[[NSURL fileURLWithPath:filePath] absoluteString], @"width": [NSNumber numberWithFloat:image.size.width], @"height": [NSNumber numberWithFloat:image.size.height]};
NSDictionary *imageInfo = @{@"path":[[NSURL fileURLWithPath:filePath] absoluteString],
@"width": [NSNumber numberWithFloat:image.size.width],
@"height": [NSNumber numberWithFloat:image.size.height]};
[resultList addObject: imageInfo];
}
}
Expand All @@ -240,10 +246,14 @@ - (void)assetsPickerController:(GMImagePickerController *)picker didFinishPickin
break;
} else {
if(self.outputType == BASE64_STRING){
NSDictionary *imageInfo = @{@"path":[data base64EncodedStringWithOptions:0], @"width": [NSNumber numberWithFloat:scaledImage.size.width], @"height": [NSNumber numberWithFloat:scaledImage.size.height]};
NSDictionary *imageInfo = @{@"path":[data base64EncodedStringWithOptions:0],
@"width": [NSNumber numberWithFloat:scaledImage.size.width],
@"height": [NSNumber numberWithFloat:scaledImage.size.height]};
[resultList addObject: imageInfo];
} else {
NSDictionary *imageInfo = @{@"path":[[NSURL fileURLWithPath:filePath] absoluteString], @"width": [NSNumber numberWithFloat:scaledImage.size.width], @"height": [NSNumber numberWithFloat:scaledImage.size.height]};
NSDictionary *imageInfo = @{@"path":[[NSURL fileURLWithPath:filePath] absoluteString],
@"width": [NSNumber numberWithFloat:scaledImage.size.width],
@"height": [NSNumber numberWithFloat:scaledImage.size.height]};
[resultList addObject: imageInfo];
}
}
Expand Down

0 comments on commit ed1adbd

Please sign in to comment.