Bug #65171 [Com]: imagescale() fails
| From: | richard at sublogic dot se | Date: | Wed, 15 Oct 2014 16:58:54 +0000 |
| Subject: | Bug #65171 [Com]: imagescale() fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-188117@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65171&edit=1
ID: 65171
Comment by: richard at sublogic dot se
Reported by: susisoy at 163 dot com
Summary: imagescale() fails
Status: Assigned
Type: Bug
Package: GD related
Operating System: CentOS 6.4
PHP Version: 5.5.0
Assigned To: remi
Block user comment: N
Private report: N
New Comment:
After talking with RemiFedora at #libgd on IRC at irc.freenode.net I got the following workaround:
Specify an explicit height for imagescale().
My system which showed the problem:
Archlinux
PHP Version 5.6.1
array (size=12)
'GD Version' => string '2.1.0-alpha' (length=11)
'FreeType Support' => boolean true
'FreeType Linkage' => string 'with freetype' (length=13)
'T1Lib Support' => boolean false
'GIF Read Support' => boolean true
'GIF Create Support' => boolean true
'JPEG Support' => boolean true
'PNG Support' => boolean true
'WBMP Support' => boolean true
'XPM Support' => boolean true
'XBM Support' => boolean true
'JIS-mapped Japanese Font Support' => boolean false
Previous Comments:
------------------------------------------------------------------------
[2014-10-15 16:50:58] remi@php.net
Despite document says third arg (height) is optional, it is, for now, mandatory.
------------------------------------------------------------------------
[2013-12-31 16:04:42] matteosistisette at gmail dot com
It looks like this function is just some kind of draft (there's a warning in the documentation
saying it's not documented), recently introduced.
If it's not intended to be used and it's still not functional, it should either be made
invisible until it's usable, or an alternative should be mentioned in the documentation.
Having to find out that it's completely broken by using it after finding it in the
documentation is terribly annoying.
------------------------------------------------------------------------
[2013-07-01 07:50:31] susisoy at 163 dot com
Description:
------------
imagescale() function cannot be used.
Test script:
---------------
<?php
$im = imagecreatefrompng('1.png');
$im2 = imagescale($im, 100);
imagepng($im2);
Expected result:
----------------
Warning: imagescale(): gd warning: one parameter to a memory allocation
multiplication is negative or zero, failing operation gracefully in
/mnt/hgfs/F/Test/index.php on line 3
Warning: imagepng() expects parameter 1 to be resource, boolean given in
/mnt/hgfs/F/Test/index.php on line 4
Actual result:
--------------
...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65171&edit=1