Just uploaded a bunch of images (~7000 images in ~250 albums) through ftp and as I went to the Zenphoto installation, I started getting this error while the galleries loaded on the index page:
`Fatal error: Maximum execution time of 30 seconds exceeded in /***/galleries/zp-core/exif/exif.php on line 723`
It loads some of the album thumbnails, and then in the place of one (random) thumbnail presents that error.
The error also happens when viewing the "Edit" tab in the admin backend. Also randomly.
(I have removed the code that pulls EXIF data from all pages of the theme.)
I'm totally baffled. Any help please?
Comments
I'm going through all my images today -- it turns out there's plenty of corrupted ones indeed that apparently did not download properly.
# PHP version: 5.2.6-3ubuntu4.2
# Graphics support: PHP GD library 2.0 or higher
# PHP memory limit: 160M (Note: Your server might allocate less!)
# MySQL version: 5.0.75
I have come across multiple photographs which are not corrupt, but do cause the script to hang. Even adding just one will cause it to lock. I have other photographs from the same camera taken on the same day with the same settings that do not cause this issue. From looking at the EXIF data between one working and one non-working photograph, I see no differences. The camera causing this is an Olympus u1030SW,S1030SW. (Also, I have tried setting the max time for script execution to 500, this did not help.)
`
Fatal error: Maximum execution time of 60 seconds exceeded in /var/www/zenphoto/zp-core/exif/exif.php on line 164
`
Is there anything I can to do avoid this issue, short of searching for problem photos one-by-one? Is this a known issue? Thank you!
If you have some PHP skills, you could insturment the exif.php script to record the image it is working on when it begins and ends processing. When there is an image with a begin processing and no end processing then you have your cuplpret.
Are you saying that I should exclude these pictures? Isn't there any way to alter the exif.php? I'm not really experienced with dealing with exif data, but I'd be happy to help in any way I can.
`
function intel2Moto($intel) {
static $cache = array();
if (isset($cache[$intel])) {
return $cache[$intel];
}
$len = strlen($intel);
$cache[$intel] = '';
for($i = 0; $i <= $len; $i += 2) {
$cache[$intel] .= substr($intel, $len-$i, 2);
if($i==100) {
break;
}
}
return $cache[$intel];
}
`
This function itself cannot be the problem. It is mearly copying the cata out a and converting it from `intel` form to `motorola` form. (I don't right now remember which is MSB first and which is LSB first.)
There is probably no loss by changing from 100 to 50. That check is to prevent the loop from going on forever. I would guess that if things are wrong at 50 they will still be wrong at 100. But without knowing actually what data is corrupt, we will not know if something is being lost. Just best guess is that your change is safe.