This might help :

array img_resize(string 'path to source image', string 'path to
destination image', string mode, int size); 
modes: 
"h" - Height 
"w" - Width 
"a" - auto (resizes by the largest dimension)

http://examples.weberdev.com/get_example.php3?count=157

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: Edward Peloke [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 18, 2003 10:39 PM
To: [EMAIL PROTECTED] Php. Net
Subject: [PHP] picture help


Hello all, I have this code that takes an image sent from a form and
resizes it for a thumbnail and for display, the problem is the pictures
look nice until this does the resizing, then the quality is
horrible...can I fix it?

Thanks,
Eddie

<?
if(!empty($myimage)){
$id=$HTTP_GET_VARS['id'];
$imgname="image_".$id.".jpg";
copy($myimage,$imgname);
unlink($myimage);
function thumbnail($i,$nw,$p,$nn) {
    $img=imagecreatefromjpeg("$i");
    $ow=imagesx($img);
    $oh=imagesy($img);
    $scale=$nw/$ow;
    $nh=ceil($oh*$scale);
    $newimg=imagecreate($nw,$nh);
    imagecopyresized($newimg,$img,0,0,0,0,$nw,$nh,$ow,$oh);
    imagejpeg($newimg, $nn);
    return true;
}

#thumbnail(filetouse,newwidth,newpath,newname);
thumbnail($imgname,100,"/imges/","t_".$imgname);
thumbnail($imgname,250,"/imges/",$imgname);

}
?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to