ID:               21265
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-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] [EMAIL PROTECTED]

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

Reply via email to