#23444 [Opn]: [chm] bug on function.imagecopyresampled.html
| From: | aaron_hawryluk at shaw dot ca | Date: | Thu, 01 May 2003 21:40:14 +0000 |
| Subject: | #23444 [Opn]: [chm] bug on function.imagecopyresampled.html | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969353000@lists.php.net to get a copy of this message | ||
ID: 23444
User updated by: aaron_hawryluk at shaw dot ca
Reported By: aaron_hawryluk at shaw dot ca
Status: Open
Bug Type: Documentation problem
Operating System: windows 2000
PHP Version: 4.3.1
New Comment:
On further examination, PHP was using php_gd.dll instead of
php_gd2.dll, altering this appears to have fixed the issue. However,
further documentation of this feature should be included in a future
release, as it was VERY difficult to find any info on gd under Windows
anywhere on the web... loads of support for UNIX, but that doesn't
really help with the .dll problem.
It appears to be only the 24-bit image functions that won't work
'out-of-the-box' under the older php_gd.dll. Perhaps the chm docs
could include a section on how to get all functions properly working
under Windows.
Previous Comments:
------------------------------------------------------------------------
[2003-05-01 16:22:16] aaron_hawryluk at shaw dot ca
I have found a bug on page function.imagecopyresampled.html
[chm date: 2002-12-27]...
imagecopyresampled does not appear to apply to the Win32 version of PHP
4.3.1 running the included php_gd.dll (zip version download from
php.net). The function is undefined and causes fatal errors when
called.
This works:
<?php
header("Content-type: image/jpeg");
$im = imagecreate (150, 30); /* Create a blank image */
$bgc = imagecolorallocate ($im, 255, 255, 255);
$tc = imagecolorallocate ($im, 0, 0, 0);
imagefilledrectangle ($im, 5, 5, 145, 25, $bgc);
imagestring ($im, 1, 5, 5, "This is an image.", $tc);
$aspect = 150/30;
$naspect = 1/$aspect;
$destimg = imagecreate(300,100);
imagecopyresized($destimg,$im,0,0,0,0,300,100,150,30);
imagejpeg($destimg);
?>
This does not:
<?php
header("Content-type: image/jpeg");
$im = imagecreate (150, 30); /* Create a blank image */
$bgc = imagecolorallocate ($im, 255, 255, 255);
$tc = imagecolorallocate ($im, 0, 0, 0);
imagefilledrectangle ($im, 5, 5, 145, 25, $bgc);
imagestring ($im, 1, 5, 5, "This is an image.", $tc);
$aspect = 150/30;
$naspect = 1/$aspect;
$destimg = imagecreate(300,100);
imagecopyresampled($destimg,$im,0,0,0,0,300,100,150,30);
imagejpeg($destimg);
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23444&edit=1