php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17535 ImageCreateFromGD2Part reports wrong parameter count
Submitted: 2002-05-30 18:37 UTC Modified: 2002-06-03 22:35 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sprice at students dot wisc dot edu Assigned:
Status: Closed Package: GD related
PHP Version: 4.2.1 OS: Darwin (OS X)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sprice at students dot wisc dot edu
New email:
PHP Version: OS:

 

 [2002-05-30 18:37 UTC] sprice at students dot wisc dot edu
Whenever I use the function ImageCreateFromGD2Part() I get the following message:

Warning:  Wrong parameter count for imagecreatefromgd2part() in /Users/lake/Sites/scripts/world_map_med.php on line 40

I have noticed that another user has mentioned this bug at:
http://www.php.net/manual/en/function.imagecreatefromgd2part.php
But I can't find any actual bug reports about this problem (or any other mentions). I have gotten ImageCreateFromGD2() to work just fine, but ImageCreateFromGD2Part() will not work, even if I add or remove random parameters.

This is my line of code that isn't working:
	ImageCreateFromGD2Part( $medimg, $x, $y, 800, 600 );

This code would be more useful for testing:
<?php
	ImageCreateFromGD2Part( "<your GD2 image here>", 1, 1, 10, 10 );
?>


This sounds like it shouldn't be to hard of a problem to fix, but then again I am not a PHP hacker ;). I have a project that I am working on that cannot continue until this is fixed because I am working with chunks of a 700 MB image.
Thx much,
Seth Price
sprice@students.wisc.edu

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-30 19:02 UTC] sprice at students dot wisc dot edu
Whenever I use the function ImageCreateFromGD2Part() I get the following
message:

Warning:  Wrong parameter count for imagecreatefromgd2part() in
/Users/lake/Sites/scripts/world_map_med.php on line 40

I have noticed that another user has mentioned this bug at:
http://www.php.net/manual/en/function.imagecreatefromgd2part.php
But I can't find any actual bug reports about this problem (or any other
mentions). I have gotten ImageCreateFromGD2() to work just fine, but
ImageCreateFromGD2Part() will not work, even if I add or remove random
parameters.

This is my line of code that isn't working:
	ImageCreateFromGD2Part( $medimg, $x, $y, 800, 600 );

This code would be more useful for testing:
<?php
	ImageCreateFromGD2Part( "<your GD2 image here>", 1, 1, 10, 10 );
?>

This sounds like it shouldn't be to hard of a problem to fix, but then
again I am not a PHP hacker ;). I have a project that I am working on
that cannot continue until this is fixed because I am working with
chunks of a 700 MB image.
Thx much,
Seth Price
sprice@students.wisc.edu


PS: I'll make this really easy for anyone who knows how to compile, check, contribute, etc. code to the PHP source tree.

I believe that in line 1148 of file /php-4.2.1/ext/gd/gd.c, the 4 should be changed to a 5.

	if ((image_type == PHP_GDIMG_TYPE_GD2PART && argc != 4) || //<- "argc != 4" should say "argc != 5" because the arg count is 5 not 4.
		argc != 1 || zend_get_parameters_ex(argc, &file, &srcx, &srcy, &width, &height) == FAILURE) {
		ZEND_WRONG_PARAM_COUNT();
	}
 [2002-06-03 22:35 UTC] sniper@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 00:01:32 2024 UTC