#21265 [Opn->Ver]: unexpected low color depth

From: Date: Sun, 29 Dec 2002 18:57:57 +0000
Subject: #21265 [Opn->Ver]: unexpected low color depth
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-28690@lists.php.net to get a copy of this message
ID: 21265 Updated by: iliaa@php.net Reported By: tho.r@gmx.net -Status: Open +Status: Verified Bug Type: GD related Operating System: Linux -PHP Version: 4.3.0 +PHP Version: 4.3.0/4.4.0 Previous Comments: ------------------------------------------------------------------------ [2002-12-29 09:25:41] tho.r@gmx.net 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 this bug report at http://bugs.php.net/?id=21265&edit=1

« previous php.bugs (#28690) next »