php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #23444 Document php_gd.dll was removed in 4.3.2
Submitted: 2003-05-01 16:22 UTC Modified: 2003-05-09 16:56 UTC
From: aaron_hawryluk at shaw dot ca Assigned: philip (profile)
Status: Closed Package: Documentation problem
PHP Version: 4.3.1 OS: windows 2000
Private report: No CVE-ID: None
 [2003-05-01 16:22 UTC] 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);
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-01 16:40 UTC] aaron_hawryluk at shaw dot ca
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.
 [2003-05-01 17:45 UTC] philip@php.net
You have a very old version of the manual but anyway the following is from ref.image:

To enable GD-support configure PHP --with-gd[=DIR], where DIR is the GD base install directory. To use the recommended bundled version of the GD library configure --with-gd. In Windows you'll include php_gd2.dll as an extension in php.ini. There is also php_gd.dll for GD1 but it's not preferred.

And this is from the imagecopyresampled() docs:

Note:  imagecopyresampled() requires GD 2.0.l or greater.

Also, php_gd.dll is no longer bundled as of PHP 4.3.2 so hopefully this problem will just go away! ;)

This bug will remain open until it's documented that php_gd.dll was removed in 4.3.2, assigning to self, and changing summary.  Also, ref.image should be expanded to mention some image functions require GD2.  I believe each function that does require GD2 already mentions this requirement.

What do you think about all of this?
 [2003-05-09 10:16 UTC] aaron_hawryluk at shaw dot ca
One note for Windows users should maybe be (and I'm not sure if this has already been fixed in the new distribution of php) that you need the FULL (ie. non-installer-based) version of PHP and you need to change the line extension=php_gd.dll to extension=php_gd2.dll.  At least, I had to.  With those changes, the problem is fixed.
 [2003-05-09 10:22 UTC] goba@php.net
This is not a place for support questions, and so 'support answers' should not mark bugs as closed. Reassign to Philip.
 [2003-05-09 16:56 UTC] philip@php.net
This has now been documented and will show up during the next manual build, changes can be seen here:

http://cvs.php.net/cvs.php/phpdoc/en/chapters/install.windows.xml
http://cvs.php.net/cvs.php/phpdoc/en/reference/image/configure.xml

Thanks for the report :)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Fri Oct 09 00:00:01 2026 UTC