|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68239 Incorrect documentation or library bug
Submitted: 2014-10-15 18:14 UTC Modified: 2014-11-07 10:17 UTC
From: richard at sublogic dot se Assigned: aharvey (profile)
Status: Closed Package: GD related
PHP Version: 5.6.1 OS: Archlinux
Private report: No CVE-ID: None
 [2014-10-15 18:14 UTC] richard at sublogic dot se
From manual page:

The function imagescale either has an implementation bug floating around or the documentation is wrong.

The issue is with the $height parameter. The docs say it can optionally be provided but the reality is the following error:

Warning: imagescale(): gd warning: one parameter to a memory allocation 
multiplication is negative or zero, failing operation gracefully ...


The only way for imagescale() to function properly at present is to explicitly provide a value for $height.

It would be very helpful if the docs gave a warning on this issue.

Test script:
$imageres = imagecreatetruecolor(600, 500);

$imageres = imagescale($imageres, 380, 380);

imagejpeg($imageres, $dstdir . $filename);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-10-17 13:44 UTC]
-Status: Open +Status: Verified
 [2014-10-17 13:44 UTC]
I think we should either fix the arginfo and the docs to make the height mandatory, or it should work when the argument is omitted.
 [2014-10-17 13:44 UTC]
-Assigned To: +Assigned To: pajoye
 [2014-11-05 15:13 UTC]
FYI the bug #65171 is fix in upcoming 5.5.19 / 5.6.3
 [2014-11-07 10:16 UTC]
Automatic comment from SVN on behalf of aharvey
Log: Note the fix for bug #65171, and generally flesh out the imagescale() docs.

Fixes doc bug #68239 (Incorrect documentation or library bug).
 [2014-11-07 10:17 UTC]
-Status: Verified +Status: Closed -Assigned To: pajoye +Assigned To: aharvey
 [2014-11-07 10:17 UTC]
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 18 05:03:33 2021 UTC