1

I am working on an image filter effects app.

A current issue with the app is that it crashes when a user picks a very large image from his photo album.

When

imagePickerController:didFinishPickingMediaWithInfo

returns the selected image, I need to present a preview of the selected image in a UIImageView.

I resize the selected image if it's large before presenting it.

For very large images (20 megapixels +) this causes the app to crash - I am not getting any memory warnings before the crash that I can act on.

I would like to prevent a crash, or at least warn the user that this might happen if they select a very large image.

Does anyone have a good idea how to implement this (crash prevention or warning) gracefully?

adriaan
  • 1,574
  • 14
  • 33
  • Without more details, there's not much we can do to help besides randomly guess. What does your `imagePickerController:didFinishPickingMediaWithInfo:` and image resizing code look like? What exactly are you seeing in the console? – Anomie Apr 27 '11 at 01:52

1 Answers1

1

update

 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo

{

[[myPicker parentViewController] dismissModalViewControllerAnimated:YES];

NSLog(@"type ur message");

[NSThread detachNewThreadSelector:@selector(useImage:) toTarget:self withObject:image];

}
Gajendra K Chauhan
  • 3,387
  • 7
  • 40
  • 55