I use a different script and works good and looks simpler than yours
add this near the top of your php
PHP Code:
function createThumbs($fname, $pathToImages, $pathToThumbs, $thumbWidth ) {
$img = imagecreatefromjpeg( "{$pathToImages}{$fname}" );
$width = imagesx( $img );
$height = imagesy( $img );
$new_width = $thumbWidth;
$new_height = floor( $height * ( $thumbWidth / $width ) );
$tmp_img = imagecreatetruecolor( $new_width, $new_height );
imagecopyresized( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height );
imagejpeg( $tmp_img, "{$pathToThumbs}{$fname}" );
}
and then this line where you want to call the function
PHP Code:
createThumbs($imagename,"path to the image","thumbnailoutpath",120);
where there is 120, change to size of the thumbnail you want it to create
this for me makes full quality thumbnails
Shaz x
__________________
mysql_connect("localhost", "brain", "sharon") or die(mysql_error());
mysql error: brain doesn't exist!
|