Welcome to WebmasterWorld Guest from 54.167.29.212

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

resize images w/o sacrificing quality

basic php image resize can really make your images look bad...

     

irock

8:05 pm on Nov 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm trying to add a JPEG image resize for my catalog. However, when I tried to use the following code. My images would look very wash out. I was wondering if there's a way to resample the size of the image w/o scarificing the quality of the original image. I'm using PHP/mySQL.

<?php
$orig_image = imagecreatefromjpeg("path/to/imagefile.jpg");
$sm_image = Imagecreate(50,50);
Imagecopyresized($sm_image,$orig_image,0,0,0,0,50,50,imagesx($orig_image),imagesy($orig_image));
Header("Content-type: image/jpeg");
imageJPEG($sm_image);
imagedestroy($sm_image);
imageDestroy($orig_image);
?>

andreasfriedrich

8:24 pm on Nov 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use imagecopyresampled [php.net] instead of imagecopyresized.

irock

9:09 pm on Nov 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you konw how to get GD 2.0 support?

Mine is only GD 1.62.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month