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

From: Date: Tue, 13 May 2003 06:43:20 +0000
Subject: #23491 [Bgs]: Very bad Quality when I use imagecopyresized
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39511@lists.php.net to get a copy of this message
ID: 23491 User updated by: ab at berg dot net Reported By: ab at berg dot net 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: can me somebody help? thanks Andreas Previous Comments: ------------------------------------------------------------------------ [2003-05-08 02:49:09] ab at berg dot net Ok, but my problim is who can I use the "the native GD library 2.0+ " with this configure Command: './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' ------------------------------------------------------------------------ [2003-05-07 20:40:59] iliaa@php.net 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. ------------------------------------------------------------------------ [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 ------------------------------------------------------------------------ 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 (#39511) next »