Scan Uses Too Much Memory

Patrick, first off, let me say - thank you. After going through the myriad of 'image gallery solutions' - yours ended up being the one I settled on.

I created a completely new template, leveraged the latest in CSS (grid960) and jQuery, modified comments, added a star rating and a javascript leftside treeview for folders.

But honestly I regret the decision, and I find myself cursing you sometimes when going through your code. :)

We have images into the multi-gig arena. Here is our latest set of problems:

When performing a scan, there is a memory spike. Can you explain the processes of what exactly goes on during a 'scan'? How are the images being processed that it is taking up so much memory? What are some ways to speed up or reduce the footprint during a scan, to also make sure it will be more reliable?

Any help is appreciated - I know this is something you created many years ago and are still supporting.