Bug #17535 Updated: ImageCreateFromGD2Part reports wrong parameter count

From: Date: Tue, 04 Jun 2002 02:35:28 +0000
Subject: Bug #17535 Updated: ImageCreateFromGD2Part reports wrong parameter count
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-9409@lists.php.net to get a copy of this message
ID: 17535 Updated by: sniper@php.net Reported By: sprice@students.wisc.edu -Status: Open +Status: Closed Bug Type: GD related Operating System: Darwin (OS X) PHP Version: 4.2.1 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2002-05-30 19:02:17] sprice@students.wisc.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-05-30 18:37:41] sprice@students.wisc.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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17535&edit=1

« previous php.bugs (#9409) next »