#21265 [NEW]: unexpected low color depth

From: Date: Sun, 29 Dec 2002 15:25:42 +0000
Subject: #21265 [NEW]: unexpected low color depth
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-28667@lists.php.net to get a copy of this message
From: tho.r@gmx.net Operating system: Linux PHP version: 4.3.0 PHP Bug Type: GD related Bug description: unexpected low color depth Hi! Before switching to PHP 4.3.0 we could create a "nice" colored thumbnail from an image via PHP and GD (1.8.x) with the following code: $thumb = imagecreate($twidth, $theight); $orig = @imagecreatefromjpeg($file); if (!$orig) { echo "Couldn't load JPEG image '$file'."; exit(); } imagecopyresized($thumb, $orig, 0, 0, 0, 0, $twidth, $theight, $width, $height); mkdir(dirname($thumbnail),0777); imagejpeg($thumb,$thumbnail,65); We had a switch statement for any supported image type (JPEG, GIF and PNG). The created image is of course smaller but has the same color depth as the original. After using PHP 4.3.0 and its bundled GD2 library the image is also created but the result has very less colors (maybe 16). I've put an example here: http://thoralf.log-out.net/tmp/php4.3.0.html I'm not sure, if I did a mistake or if there is something missing now - but it works with PHP4.2.2 very well. The PHPInfo from the server can be found here: http://m84.de/phpinfo.php bye Thoralf -- Edit bug report at http://bugs.php.net/?id=21265&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21265&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21265&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21265&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21265&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21265&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21265&r=support Expected behavior: http://bugs.php.net/fix.php?id=21265&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21265&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21265&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21265&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21265&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21265&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21265&r=isapi

« previous php.bugs (#28667) next »