RE: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(



Hi,

imagecopyresampled might help you... I use that and it works without
problems.

/Peter

-----Original Message-----
From: Steven Macintyre [mailto:steven@xxxxxxxxxxxxxxxxxxxxx]
Sent: Wednesday, December 27, 2006 10:17 AM
To: php-general@xxxxxxxxxxxxx
Subject: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(

Hi All,

I have done some searching via google and some answers say change
copyimageresampled to copyimageresized etc

I have tried all fixes ... to no avail


I have one image here 1280 x 960 (150 dpi) 24 depth

When using the following it pixelates ...

function createthumb($name,$filename,$new_w,$new_h)
{
$system=explode(".",$name);
$src_img=imagecreatefromjpeg($name);
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x > $old_y)
{
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y)
{
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y)
{
$thumb_w=$new_w;
$thumb_h=$new_h;
}
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);

imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
imagejpeg($dst_img,$filename);
imagedestroy($dst_img);
imagedestroy($src_img);
}

Which I am of course calling with
createthumb($add,'../pics/'.$largeval,350,263);

Now ... afaik my new sizes are proportional to the big ones ... but it
pixelates :(

However,

Using an image 1600 x 1200 (96 dpi) 24 depth it works and there is no
pixilation

Can someone perhaps assist now?



Kind Regards,


Steven Macintyre
http://steven.macintyre.name
--

http://www.friends4friends.co.za

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



Relevant Pages

  • RE: [PHP] Looking for help with forms/variables and an array!
    ... I am trying to get a php form variable into the above sql query. ... PHP General Mailing List ... To unsubscribe, visit: http://www.php.net/unsub.php ...
    (php.general)
  • Re: [PHP] Project management systems
    ... I'd like to be able to make mods so PHP is the logical choice since it's the language I know best, and as Tony will tell you, it's perfect and doesn't need no feeble minded Java guys trying to improve it. ... Basic requirements are time tracking for multiple coders, generating invoices per project based on start and end date. ... PHP General Mailing List ...
    (php.general)
  • RE: [PHP] Add Reply-To to this list(s)
    ... When I check my mails from PHP General Mailing List it's to learn something ... IMHO we'd be better off having a PHP Forum on php.net and scrub the Mailing ... there are mail clients available which are ...
    (php.general)
  • Re: [PHP] developers life
    ... vast amount of inhuman focus, followed by inability to remain focussed ... all projects suddenly become uninteresting and all motivation is lost ... Application and Templating Framework for PHP ... PHP General Mailing List ...
    (php.general)
  • RE: [PHP] mysql load_file retreival
    ... I was following the example given on the php site that someone was using to ... Subject: mysql load_file retreival ... a smaller pdf and it worked. ... PHP General Mailing List ...
    (php.general)