Jayd Saucedo

Blog

Saurdo Directory Lister Update
I have been putting off this update for a while thinking that I could add some more features before I release it. Most of those features never reached fruition so I think that now is as good a time as any to release this update.

New Features

I never really found a good way to detect if an image was going to create a memory error for the thumbnailer. It takes an immense amount of memory to convert an image from its original format, to true color, and then to jpeg. My host's default memory limit for PHP is 90 mbs and I found that images around 16000000px (16mp) maxed out that memory cap. So i just said that if the width x height is greater than 16mp don't even try to thumbnail it and instead just display an image with the name of it.

The code looks like this:

if(($imgsize[0] * $imgsize[1]) > $magic_number){
        
imageCenterString( $THUMBNAIL_WIDTH, $THUMBNAIL_HEIGHT, basename($image), $imageFontSize );
        exit();
    }

Very simple. The magic number is defined with the rest of the settings. This obviously isn't the best way to go about this but like I said, I've been holding this release off to add more features for too long. So this kluge will have to hold for now.

You can download the new script here.