#23491 [Fbk->Opn]: Very bad Quality when I use imagecopyresized
| From: | ab at berg dot net | Date: | Wed, 07 May 2003 18:24:37 +0000 |
| Subject: | #23491 [Fbk->Opn]: Very bad Quality when I use imagecopyresized | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-39241@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: Feedback
+Status: Open
Bug Type: GD related
Operating System: RedHat Linux 7.0 with gd-1.8.4-9
PHP Version: 4.3.2RC2
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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
------------------------------------------------------------------------
[2003-05-05 09:26:57] rasmus@php.net
Actually, never mind, just took a look at your images. I assume you
were also using gd-1.8 with PHP 4.2.3?
------------------------------------------------------------------------
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