You could create a php thumbnailer and call the image as
img src="thumb/image.jpg" then you don't even need to create thumbnails for all your images and it displays them as smaller sizes for sake of our monitors. I will show a basic code for jpg, gif and png. You can add bmp and such if you need.
example:
www.yoursite.com/images/thumb/filename.jpg
.htaccess (This tells your server to force 'thumb' to act as 'thumb.php' without the .php extension)
--------------
PHP Code:
<Files thumb>
ForceType application/x-httpd-php
AcceptPathInfo On
</Files>
PHP Code:
<?php
$server = $_SERVER['REQUEST_URI'];
$url_array = explode('/',$server);
$image = $url_array[3];
// adjust the url array by changing the '3' to point to the actual image filename
// This is added in case of 404 errors:
$fullimageurl = 'http://www.yoursite.com/images/' .$image;
$fullimageurl2 = 'http://www.yoursite.com/images/noimagefound.jpg';
$c = curl_init($fullimageurl);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_exec($c);
$http_code = curl_getinfo($c, CURLINFO_HTTP_CODE);
curl_close($c);
// var_dump($http_code);
// exit();
if ($http_code == 404) {
$imagesurl = $fullimageurl2;
} elseif ($http_code == 302) {
$imagesurl = $fullimageurl;
} else {
$imagesurl = $fullimageurl;
}
// set the max width and height in pixels
$width = 120;
$height = $width;
// this grabs the extension
$info = pathinfo($imagesurl);
$extension = $info['extension'];
$extension = strtolower($extension);
if(($extension==="jpeg")||($extension==="jpg")) {
list($width_orig, $height_orig) = getimagesize("$imagesurl");
if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg("$imagesurl");
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
header('Content-type: image/jpeg');
imagejpeg($image_p, null, 100);
imagedestroy($image_p);
exit();
}
if($extension==="gif") {
list($width_orig, $height_orig) = getimagesize($imagesurl);
if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromgif($imagesurl);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
header('Content-type: image/gif');
imagegif($image_p, null, 100);
imagedestroy($image_p);
exit();
}
if($extension==="png") {
list($width_orig, $height_orig) = getimagesize($imagesurl);
if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefrompng($imagesurl);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
header('Content-type: image/png');
imagepng($image_p);
imagedestroy($image_p);
exit();
}
?>
Not sure if it's what you are looking for, but my 2cents.
Thanks,
Kevin