|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-12-29 13:13 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 10:00:01 2025 UTC |
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