Doc #68239 [Opn->Ver]: Incorrect documentation or library bug

From: Date: Fri, 17 Oct 2014 13:44:21 +0000
Subject: Doc #68239 [Opn->Ver]: Incorrect documentation or library bug
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-11563@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68239&edit=1

 ID:                 68239
 Updated by:         tyrael@php.net
 Reported by:        richard at sublogic dot se
 Summary:            Incorrect documentation or library bug
-Status:             Open
+Status:             Verified
 Type:               Documentation Problem
 Package:            GD related
 Operating System:   Archlinux
 PHP Version:        5.6.1
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[2014-10-15 18:14:56] richard at sublogic dot se

Description:
------------
---
From manual page: http://www.php.net/function.imagescale
---

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 ...

Link: https://bugs.php.net/bug.php?id=65171

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);
imagedestroy($imageres);



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=68239&edit=1


Thread (4 messages)

« previous php.doc.bugs (#11563) next »