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

From: Date: Thu, 08 May 2003 01:41:00 +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-39267@lists.php.net to get a copy of this message
ID: 23491 Updated by: iliaa@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: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php If you change ImageCreate() to ImageCreateTrueColor() the images instantly become nice & clear. For the record I have tested this php 4.2.3 linked against the native GD library 2.0+ the results were the same. Previous Comments: ------------------------------------------------------------------------ [2003-05-07 13:24:36] ab at berg dot net Hi Sniper, This ist the Script online: http://www.andreas.boehm.de/1/thumb.phtml And the Source-Code is: <-- snip --> <? imgthumb("ori.JPG","thumb.jpg","65","150"); echo "<img src=thumb.jpg>"; // Erstellt ein Thumbnail function imgthumb($ori,$thump,$thumbQuality,$thumbWidth) { // Function die aus einem JPEG-Bild ein // kleineres Bild erzeugt. // $ori = Pfad der Originaldatei // $thump = Pfad des kleinen Bilds $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"); } ?> <-- snap --> At the moment the Script works perfectly - i have installed the PHP Version 4.2.3. If I install 4.3.x with the same script would be very bad like: http://www.andreas.boehm.de/1/bad.jpg Bye Andreas ------------------------------------------------------------------------ [2003-05-06 18:35:25] sniper@php.net Please provide a _COMPLETE_ example script. ------------------------------------------------------------------------ [2003-05-06 00:49:25] ab at berg dot net Hi Sniper, i use the 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"); } And this are the example Images: 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 Andreas ------------------------------------------------------------------------ [2003-05-05 16:39:07] sniper@php.net Please provide a complete example script which actually produces the result you show here. ------------------------------------------------------------------------ [2003-05-05 09:36:36] ab at berg dot net Hi Rasmus, really? Why works the thumbnail function with php 4.2.3 and gd 1.8.x perfectly with more than 256 colours and with php 4.3.x not? How can I compile the GD2 bundled? What must I change in my configure command? Thanks a lot Andreas ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/23491 -- Edit this bug report at http://bugs.php.net/?id=23491&edit=1

« previous php.bugs (#39267) next »