imagefill() on images larger than 181x181

Need help with Photoshop, the GIMP, Illustrator, or others? Want to show off your work? Looking for advice on your newest Flash stuff?

Moderator: General Moderators

Post Reply
sternobread
Forum Newbie
Posts: 2
Joined: Tue Oct 19, 2004 10:52 am

imagefill() on images larger than 181x181

Post by sternobread »

Ok... I'm not sure if this is a bug w/ php or gd, or if I'm doing somthing wrong here:

Code: Select all

<?php
$img_big = imagecreatetruecolor(182, 182);
$brown=imagecolorallocate($img_big, 0xFF, 0xEF, 0xD8);
imagefill($img_big, 0, 0, $brown);
imagepng($img_big, "/usr/local/apache2/htdocs/cart/images/999999-1-big.png");
?>
Running this bit of script yields a 182x182 png image that is all black. If i reduce the imagecreatetruecolor size to 181x181 or less, it fills it with the tan-ish color specified by imagecolorallocate().

Is there some reason the imagefill wouldn't work on images larger than 181x181?

Can anyone shed some light on this?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Moved to Graphics.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Interesting issue, I'll have a look into later.. in the mean time though, you could use imagefilledrectangle() instead if you're just trying to create a solid background colour.
Post Reply