Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resized image quality

Status
Not open for further replies.

Dweezel

Technical User
Feb 12, 2004
428
GB
I'm using PHP HTTP uploading to add photos to a gallery. I'm resizing the images using PHP functions, creating small thumbnails and larger images which display when the thumbnails are clicked.

The quality of the larger images is not great but is acceptable. Some of the thumbnails are pretty bad though. They're choppy and pixelated.

I'll put the resize code I'm using below. Does anyone have any tweaks I could use to improve the quality of the final images? I've already got jpeg quality cranked up to 100.

Code:
 $src2=ImageCreateFromJpeg($upfile);
 $dst2=ImageCreateTrueColor($thumbwidth,$thumbheight);

ImageCopyResized($dst2,$src2,0,0,0,0,$thumbwidth,$thumbheight,$width,$height);

  $thumbpath='ups/covers/';
  $thumbname='cov_'.$filename;
  $thumbfile=$thumbpath.$thumbname;

  ImageJpeg($dst2,$thumbfile,100);

  ImageDestroy($dst2);
  ImageDestroy($src2);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top