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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: diyu at eeis dot ustc dot edu dot cn
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

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