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

Large number of Images? #14

Closed ghost closed 11 years ago

ghost commented 13 years ago

I notice that there is a problem with the component if you have a very large number of images (6000 images does it for me), the problem (if I understand it correctly) is that the component initializes all ELCAsset with a thumbnail and stores them in the elcAssets array. If you have for instance 6000 images the component crashes when you start scrolling to all these items.

Any suggestions how to fix this issue, been trying to play around with it for last few days but haven't really come up with any good solutions (that doesn't bring performance down or make it extra complicated with threads).

dautermann commented 13 years ago

I've seen (and jumped over) the same issue as you. Any table with over 1500 images and ELCImagePickerController crashes.

Since I'm trying to get more involved in GitHub, I've just forked ELCImagePickerController and will attempt to check-in modified source code that will get you (and anyone else who is hitting this problem) over the finish line.

dautermann commented 13 years ago

Okay Dale! I've managed to check in my changes (and I may document them a bit better over the rest of this weekend).

The two big changes in my branch are:

1) In ELCAsset.m, I'm now explicitly resizing the thumbnail image with some helper categories instead of using the memory hog [ALAsset thumbnail] method

2) Instead of depending on auto-released ELCAssetCells (which may or may not get unexpectedly released when ELCImagePicker receives a memory warning, which happens with huge albums), I now keep & retain my ELCAssetCells in a NSMutableArray.

And of course you'll probably see a few other enhancements in my code as well.

Let me know if this helps you somewhat.

And if it does, maybe we can mark the issue as "closed" (unless the Collin & the ELC people want to incorporate these changes).

jvanmetre commented 11 years ago

I have gone ahead an implemented a better solution than the what existed previously here, and am reusing the uiimageviews in the tableviewcells as should have been done originally. Versions > 2ac497ef0b2e1d18a9d842e228dcbade5a5e9b82 (0.0.4) contain this.