php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #277 ImageSetPixel(image,x,y,color) always set the pixel (y,y)
Submitted: 1998-04-16 04:32 UTC Modified: 1998-04-16 07:55 UTC
From: diyu at eeis dot ustc dot edu dot cn Assigned: rasmus (profile)
Status: Closed Package: Performance problem
PHP Version: 3.0 Release Candidate 3 OS: Linux(2.0.18)
Private report: No CVE-ID: None
 [1998-04-16 04:32 UTC] diyu at eeis dot ustc dot edu dot cn
<?
	Header("Content-type: image/gif");
	$img = ImageCreate(256,256);
	$col1 = ImageColorAllocate($img,0,0,0);
	$col2 = ImageColorAllocate($img,255,0,0);
	ImageSetPixel($img,255,0,$col2);
	ImageSetPixel($img,255,1,$col2);
	ImageSetPixel($img,255,3,$col2);
	ImageSetPixel($img,255,4,$col2);
	ImageGif($img);
	ImageDestroy($img);
?>

The script only sets pixels on (0,0) to (4,4)

The problem comes from a wrongly-written line
in functions/gd.c(line 661):
	x = yarg->value.lval;
I think it should be:
	x = xarg->value.lval;

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-04-16 07:55 UTC] rasmus
This was fixed a little while ago. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 05:01:29 2024 UTC