how to increase thumbnail quality
Posted: Sat Dec 13, 2008 10:56 pm
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
here is my code, the quality of the thumbnail is really bad. almost white and black with blur. anyone know how to make my code better?
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
here is my code, the quality of the thumbnail is really bad. almost white and black with blur. anyone know how to make my code better?
Code: Select all
function makethumb($srcFile,$dstFile,$dstW,$dstH) {
$data = GetImageSize($srcFile,&$info);
switch ($data[2]) {
case 1:
$im = @ImageCreateFromGIF($srcFile);
break;
case 2:
$im = @imagecreatefromjpeg($srcFile);
break;
case 3:
$im = @ImageCreateFromPNG($srcFile);
break;
}
$srcW=ImageSX($im);
$srcH=ImageSY($im);
$ni=ImageCreate($dstW,$dstH);
Imagecopyresampled($ni,$im,0,0,0,0,$dstW,$dstH,$srcW,$srcH);
ImageJpeg($ni,$dstFile, 80);~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: