[Solved] Thumbnails BUT they lose there quality, badly.
Posted: Tue Aug 08, 2006 9:47 am
Ok I have a site (ain't gonna post the link because it's a rude fetish site) and people upload a picture, and it's staus (in the database) going to pending, which is then when I go into my control panel and accept or deny it. If I accept it then it gets the image from teh directory and makes a thumbnail of it. However the thumbnails come out like really dodgy quality.
Example...
Proper image ( me :p - yes a chav ("UK thing") )

Thumbnail

Notice how dodgy the thumbnail is? Now I used a tutorial on a website to make the thumbnails and this is what I'm using.. any ideas on how to make it better??
Example...
Proper image ( me :p - yes a chav ("UK thing") )

Thumbnail

Notice how dodgy the thumbnail is? Now I used a tutorial on a website to make the thumbnails and this is what I'm using.. any ideas on how to make it better??
Code: Select all
<?php
// *snipped other code*
// Make Thumbnail
$src_img = imagecreatefromjpeg("../pics/$thum_filename");
$origw=imagesx($src_img);
$origh=imagesy($src_img);
$new_w = 100;
$new_h=150;
$dst_img = imagecreate($new_w,$new_h);
imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));
imagejpeg($dst_img, "../thumbs/th_$thum_filename", 100);
echo "Image Approved and has been made public. ";
return true;
?>