php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36683 imagefill doesn't work on imagecreatetruecolor images
Submitted: 2006-03-10 17:51 UTC Modified: 2006-03-10 22:28 UTC
From: mike at agftech dot com Assigned: pajoye (profile)
Status: Not a bug Package: GD related
PHP Version: 5.1.3RC2-dev OS: Fedora 3
Private report: No CVE-ID: None
 [2006-03-10 17:51 UTC] mike at agftech dot com
Description:
------------
imagefill() does not work on images created with the function imagecreatetruecolor().  Any attempt to use imagefill() returns the standard black image.

Note:  I am using the GD version that is bundled with PHP 5.1.2

Reproduce code:
---------------
$print = imagecreatetruecolor(300, 500);
$image = imagecreatetruecolor(555, 555);
$color = imagecolorallocate($image, 255, 255, 0);

imagefill($image, 0, 0, $color);

imagecopy($image, $print, 50, 50, 0, 0, 300, 500);

header("Content-type: image/jpg");
imagejpeg($image);
imagedestroy($image);

Expected result:
----------------
A 555x555 yellow square with a 300x500 black square offset 50x50 inside.

Actual result:
--------------
555x555 black square.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-10 18:38 UTC] pajoye@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Use the bundle GD or be sure that you use the bundle GD. It works perfectly.
 [2006-03-10 19:04 UTC] mike at agftech dot com
"Use the bundle GD or be sure that you use the bundle GD. It works perfectly."

I AM using the bundled GD and it is clearly not working perfectly.
 [2006-03-10 19:17 UTC] pajoye@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip


 [2006-03-10 19:41 UTC] mike at agftech dot com
Still doesn't work.  Big black square.

Here is my configure string:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-gd --with-zlib --with-jpeg --with-jpeg-dir=/usr/local/lib

If this is an error with my setup, then I appolgize, but I have found absolutly zero helpfull information about this problem anywhere.
 [2006-03-10 20:25 UTC] pajoye@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

Please check your phpinfo entry, and paste the gd section here (or put the phpfinfo online and paste the link to it here).
 [2006-03-10 20:31 UTC] mike at agftech dot com
I just installed the latest CVS snapshot, when instructed to 3 comments ago.  I would say that qualifies for the latest version.

PHP INFO:
PHP Version 5.1.3RC2-dev

GD:
GD Support 	enabled
GD Version 	bundled (2.0.28 compatible)
GIF Read Support 	enabled
GIF Create Support 	enabled
JPG Support 	enabled
PNG Support 	enabled
WBMP Support 	enabled
XBM Support 	enabled
 [2006-03-10 22:28 UTC] pajoye@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

http://sean.caedmon.net/pierreimg.php
http://pear.thepimp.net/36683.php

It works (even before 5.1.2), you are doing something wrong, please ask on one of the general lists for support (see the support link on our site).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 07:01:32 2024 UTC