GD 2.0.28 + PHP 4.4.2 + pixelation :(

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux