you can force the image size displayed without doing that...
here is the html... your php just has to generate it....
<img style="border: 0px solid ; width: 300px; height: 80px;" alt="alternate text" src="images/name.jpg">
function createthumb($name,$filename,$new_w,$new_h){
$system=explode('.',$name);
if (preg_match('/jpg|jpeg/',$system[1])){
$src_img=imagecreatefromjpeg($name);
}
if (preg_match('/png/',$system[1])){
$src_img=imagecreatefrompng($name);
}
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x > $old_y) {
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y) {
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y) {
$thumb_w=$new_w;
$thumb_h=$new_h;
}
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
if (preg_match("/png/",$system[1]))
{
imagepng($dst_img,$filename);
} else {
imagejpeg($dst_img,$filename);
}
imagedestroy($dst_img);
imagedestroy($src_img);
}
createthumb('pics/orange.jpg','thumbs/tn_orange.jpg',100,100);
<?php
$file_full = './images/' . $file;
$file_thumb = './images/thumbnails/' . $file;
$image_full = imagecreatefromjpeg ($file_full);
$image_thumb = imagecreatetruecolor(400, 300);
$image_image_x = imagesx($image_full);
$image_image_y = imagesy($image_full);
imagecopyresampled ($image_thumb, $image_full, 0, 0, 0, 0, 400, 300, $file_image_x, $file_image_y);
//imagedestroy ($image_full); //get some memory back
imagejpeg($image_thumb, $file_thumb, 80);
?>
woprked over in the other forum/
yeah i agree the purpose is so the thumbs load fast and it probably matters with the jpg format... but probably not so much in a more compressed format such as png or gif...