I am using ChuteSDK to import multiple images from photo library something like this:
-(void)doneSelected{
NSMutableArray *returnArray = [NSMutableArray array];
[self showHUD];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^(void){
for(id object in [self selectedAssets]){
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if([object isKindOfClass:[GCAsset class]]){
ALAsset *asset = [object alAsset];
NSMutableDictionary* temp = [NSMutableDictionary dictionary];
[temp setObject:[[asset defaultRepresentation] UTI] forKey:UIImagePickerControllerMediaType];
[temp setObject:[UIImage imageWithCGImage:[[asset defaultRepresentation] fullScreenImage] scale:1 orientation:(UIImageOrientation)[[asset defaultRepresentation] orientation]] forKey:UIImagePickerControllerOriginalImage];
[temp setObject:[[asset defaultRepresentation] url] forKey:UIImagePickerControllerReferenceURL];
[returnArray addObject:temp];
}
[pool release];
}
dispatch_async(dispatch_get_main_queue(), ^(void) {
if(delegate && [delegate respondsToSelector:@selector(PhotoPickerPlusController:didFinishPickingArrayOfMediaWithInfo:)])
[delegate PhotoPickerPlusController:[self P3] didFinishPickingArrayOfMediaWithInfo:returnArray];
[self hideHUD];
});
});
}
But fullScreenImage
is giving me a scaled down version of the original image and if I use fullResolutionImage
it is causing low memory warning
issue due to which the app is crashing.
How can I get the image with original resolution without causing memory problems.
P.S: I'm not using ARC
in my project.