slow display -- fixed with EXIF time limit

This software is just fantastic - perfect for me !

But 2 albums were loading very slowly.
The images in these albums were large (2-3MBytes) JPEGs
that were scanned from 35mm slides
and saved from Photoshop 5.0 many years ago.

I traced the problem to `read_exif_data_raw()` in exif.php.
I echo'd the time required to go through the for() loop that
searches for the EXIF marker, and some files were taking 10 seconds.
They are all located on a NAS device on my home network.
I assumed the file was was searched all the way to the end
for the marker, but didn't actually check this.

So I used the function `microtime()` to break out of the loop
if the EXIF marker has not been found in 0.010 seconds.
This is plenty of time for all my JPEGs that actually have the marker,
which seems to be at byte 4 (cameras are Sony and Panasonic).

All albums are working fine now !

Note that `microtime()` may not be available on Windows.
I can't test that here.
I'm using PHP 5.2.4 on OpenSUSE 10.3, and zenphoto v 1.1.5.
If microtime() is not available, perhaps there could be
a limit on the number of times through the loop,
or the number of bytes from the beginning of the file ?

Glenn
Sign In or Register to comment.