I asked this question last week and thought I had it fixed but it still
doesn't seem to work.  I use the code below to allow the user to upload
their images, once uploaded the images don't look nearly as good as they did
before uploading.  Another interesting thing is that if you right click on
the images, they don't give you the option of saving the image, only saving
as background but maybe that is because they are jpegs.  Do I need to use a
higher resolution picture?

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=imagecreatetruecolor($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);

here is the site if anyone is interested,
http://www.wardsmotorsports.com

Thanks,
Eddie


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

Reply via email to