I found it worked best when I did the comparators in this order:
/*-----------------------------------------------------------------------------------------------------------
New 7/13/2007 (Friday the 13th!): It appears that filesize() runs the fastest of the three comparators,
thus should run first, as any file that is too large for this app should not display regardless of its
identity, otherwise, keep going
------------------------------------------------------------------------------------------------------------*/
if (@filesize(actual_path("$locationPath/" . $self->{$section . '_name'})) > (int)$maxSize) return false;
if (!preg_match('/^image\//i', @mime_content_type(actual_path("$locationPath/" . $self->{$section . '_name'})))) return false;
$imgStatArray = @getimagesize(actual_path("$locationPath/" . $self->{$section . '_name'}));
if (!is_array($imgStatArray) || @sizeof($imgStatArray) == 0) return false;
And incidentally, I couldn't find a single way to deal sensibly with warnings thrown for local files that even an is_file() threw a warning as well as false. Ideas?