no image for a particular ISBN, you get a broken image.
With the right apache config, maybe you could use an .htaccess file in the images dir which says: ErrorDocument 404 /path/to/some/file.png
I did a little investigation of apache config solutions... The disadvantage to the above system, as far as I can tell, is that it depends on having the image load directly in the browser, while what we want is the image to load inline with a page like opac-detail.pl. A PHP solution was suggested to me in which the image tag point to a php file, passing the ISBN as a parameter. The PHP file then checks for the existence of the image, and if delivers it if found. If not it delivers an alternate. Here's a snippet, with $img_location being the full path to the image file: $buffer = @file_get_contents($img_location); if($buffer){ header('Content-Type: image/jpg'); header('Content-Length: '.strlen($buffer)); echo $buffer; } Here's the documentation for the file_get_contents if that helps explain: http://us4.php.net/manual/en/function.file-get-contents.php I'm sure there's an easy Perl solution to match, but it's beyond my skills. If anyone wants to step up I'd certainly be grateful. -- Owen
participants (1)
-
Owen Leonard