php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19487 ImageCreateFromGD2Part() don't accept some vars
Submitted: 2002-09-18 20:42 UTC Modified: 2002-09-19 20:29 UTC
From: sprice at wisc dot edu Assigned:
Status: Closed Package: GD related
PHP Version: 4.2.3 OS: Darwin 6 (Mac OS 10.2)
Private report: No CVE-ID: None
 [2002-09-18 20:42 UTC] sprice at wisc dot edu
When I was working on a different bug (http://bugs.php.net/bug.php?id=19418) I noticed that if I used this line:

$img = ImageCreateFromGD2Part( $medimg, 1, 1, 800, 600 );

The script workedfine , but if I put single quotes around some vars like this:

$img = ImageCreateFromGD2Part( $medimg, 1, 1, '800', '600' );

the httpd proccess was thrown into some loop that used 100% of CPU time.

While checking this out further, I noticed that these programs run the second that I requested the file (taken from top):

 9233 c++filt3     0.0%  0:00.00   1     9    14    48K   400K   268K  1.37M
 9232 crashdump   99.3%  0:02.12   2    15   404  25.2M  27.9M  33.2M  59.7M 

and then the httpd proccess goes wild:

 9235 httpd       56.9%  0:00.64   1     8  2179   576K+ 13.7M+ 2.65M+ 3.49G-
 
(next second)

 9235 httpd       99.1%  0:01.74   1     8  2179   600K+ 13.7M  2.67M+ 3.49G 
 
I am not much of a C hacker, so I really have no clue as to what is going on.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-18 20:55 UTC] sprice at wisc dot edu
Just FYI, I was having problems with some vars that I got from $HTTP_GET_VARS[]. I had to add a few lines to cast the vars as ints to get it to work.

example

$x = (int) $x;
$y = (int) $y;
$medimg = ImageCreateFromGD2Part( $medimg, $x, $y, 800, 600 );
 [2002-09-19 20:29 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot 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 in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 20:01:29 2024 UTC