#23491 [Opn->Bgs]: Very bad Quality when I use imagecopyresized

From: Date: Mon, 05 May 2003 14:22:50 +0000
Subject: #23491 [Opn->Bgs]: Very bad Quality when I use imagecopyresized
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39078@lists.php.net to get a copy of this message
ID: 23491 Updated by: rasmus@php.net Reported By: ab at berg dot net -Status: Open +Status: Bogus Bug Type: GD related Operating System: RedHat Linux 7.0 with gd-1.8.4-9 PHP Version: 4.3.2RC2 New Comment: gd-1.x only supports 256 colours. You should be using the bundled version of gd2 and then ImageCreateTrueColor() instead of ImageCreate() in your code. Then the thumbnail would look nice. Previous Comments: ------------------------------------------------------------------------ [2003-05-05 08:51:07] ab at berg dot net Hi Derick, here my thumbnail-function: function imgthumb($ori,$thump,$thumbQuality,$thumbWidth) { $origImageHandle = ImageCreateFromJPEG($ori); $imageWidth = imagesx($origImageHandle); $imageHeigth = imagesy($origImageHandle); $thumbHeigth = floor($thumbWidth * $imageHeigth / $imageWidth); $thumbImageHandle = ImageCreate("$thumbWidth","$thumbHeigth"); imagecopyresized($thumbImageHandle,$origImageHandle,0,0,0,0,$thumbWidth,$thumbHeigth,imagesx($origImageHandle),imagesy($origImageHandle)); imagejpeg($thumbImageHandle,$thump,"$thumbQuality"); } Thx for your fast answer Andreas ------------------------------------------------------------------------ [2003-05-05 08:11:15] derick@php.net Post a link to your code please. Derick ------------------------------------------------------------------------ [2003-05-05 07:57:04] ab at berg dot net Hello, when I use the function imagecopyresized with the PHP Version 4.3.1 or 4.3.2RC2 the new Image has a very bad quality. If use the PGP Version 4.2.3 it works very fast and with good quality. For example: Original Image: http://www.andreas.boehm.de/1/ori.JPG Image with 4.2.3: http://www.andreas.boehm.de/1/good.jpg Image with 4.3.x: http://www.andreas.boehm.de/1/bad.jpg I have install the GD-Lib 1.8.4-9 and my configure command for the version 4.2.3 and 4.3.x is: './configure' '--with-mysql' '--with-gd' '--with-apxs' '--with-jpeg-dir' '--with-png-dir' '--with-zlib-dir' '--enable-track-vars=yes' '--enable-url-includes=yes' '--with-tiff-dir' '--with-pdflib' '--enable-shared-pdflib' '--with-ttf' '--with-imap' '--with-kerberos' '--with-imap-ssl' '--with-gettext' '--enable-ftp' Please help me - Thank you Andreas ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23491&edit=1

« previous php.bugs (#39078) next »