RE: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(
- From: lists@xxxxxxxxxxx ("Peter Lauri")
- Date: Wed, 27 Dec 2006 10:38:59 +0100
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
.
- Follow-Ups:
- RE: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(
- From: "Steven Macintyre"
- RE: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(
- References:
- GD 2.0.28 + PHP 4.4.2 + pixelation :(
- From: "Steven Macintyre"
- GD 2.0.28 + PHP 4.4.2 + pixelation :(
- Prev by Date: GD 2.0.28 + PHP 4.4.2 + pixelation :(
- Next by Date: RE: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(
- Previous by thread: GD 2.0.28 + PHP 4.4.2 + pixelation :(
- Next by thread: RE: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(
- Index(es):
Relevant Pages
|