B-Sides / ELCImagePickerController

A clone of the UIImagePickerController using the Assets Library Framework allowing for multiple asset selection
http://www.icodeblog.com
1.65k stars 469 forks source link

Crashed when selecting more than 100 images from photo library #50

Closed ram2386 closed 11 years ago

ram2386 commented 11 years ago

When select more than 100 images then application got received memory warning and then it crashed.

Please let me know if you required anything regarding for the same.

jvanmetre commented 11 years ago

Support for being able to tell the image picker whether or not to return images is planned in a future version. Until that time, see https://github.com/B-Sides/ELCImagePickerController/issues/36 for a workaround you can implement in your own code.

ips-pablon commented 9 years ago

I run into the same problem, but workaround explained on #36 wasn't good enough as you lose the ability to select photos from "My Photo Stream". Instead I modified the code in ELCImagePickerController.m method: (void)selectedAssets:(NSArray *)assets and instead of using ALAssetRepresentation fullResolutionImage I'm using the method explained here: http://stackoverflow.com/a/16382923/454165.

Performance is way better, so now I'm able to return Full Size images instead of only URLs.

My app doesn't need to upload 100 photos at once so I haven't tested with 100, but tested with 30 on and old iPhone 4 8GB and worked pretty good. (with ALAssetRepresentation the app crashed on iPhone 4 if I selected more than 6-8 photos!)

manide commented 9 years ago

I solved the problem with the photo stream images by directly returning the ALAsset objects instead of just their URL. Perfect and easy "hack" for my case, but probably no solution "for the masses". See:

https://github.com/streetspotr/ELCImagePickerController/commit/c901a009b7c87dbb067a708f13defa118a31f0f4