php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42522 imagefill not reliable
Submitted: 2007-09-02 21:48 UTC Modified: 2007-09-11 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jeffiel at 9star dot com Assigned: pajoye (profile)
Status: No Feedback Package: GD related
PHP Version: 5.2.4 OS: FC 2
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: jeffiel at 9star dot com
New email:
PHP Version: OS:

 

 [2007-09-02 21:48 UTC] jeffiel at 9star dot com
Description:
------------
Just upgraded to 5.2.4, and GD image functions, particularly imagefill, 
is not reliable.  Sometimes it works, sometimes it fails silently.  
Using [GD Version] => bundled (2.0.34 compatible).  Seems similar to bug 
#36683, which was marked as bogus for unspecified reasons.

Reproduce code:
---------------
$im = imagecreatetruecolor(625, 26);
imagefill($im, 0, 0, imagecolorallocate($im, 255, 0, 0));
header("Content-type: image/png");
imagepng($im);



Expected result:
----------------
A red png, 625 x 26

Actual result:
--------------
A black png, 625 x 26

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-03 05:27 UTC] pajoye@php.net
I can't reproduce this problem. Do you use the bundled version or an external library? If you use an external library, which version? (you can see it in your phpinfo or using gdlib-config --version).

To configure php to use the bundled gd version, use "./configure --with-gd ..." (without argument).
 [2007-09-03 05:41 UTC] jeffiel at 9star dot com
As noted, the bundled version.  Here's my configure line:

'./configure'  '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-
mysql=/usr/local/mysql-standard-5.0.19-linux-i686-glibc23' '--
with-gd' '--with-png-dir=/usr/local/lib' '--with-jpeg-
dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-zlib-
dir=/usr/local/lib' '--enable-simplexml' '--with-xsl=/usr/local/lib' 
'--with-ldap=/usr/local/openldap' '--with-ldap-sasl' '--with-
openssl=/usr/local/ssl' '--with-gettext=/usr/local' '--with-
mcrypt=/usr/local' '--with-mime-magic' '--enable-bcmath' '--with-
oci8=/opt/oracle/product/9.2.0/' '--with-curl=/usr'


The problem is not consistent, but happens about 90% of the time.  I 
don't see any pattern to it.

My current workaround is using imagefilledrectangle instead, which 
works reliably.
 [2007-09-03 08:14 UTC] pajoye@php.net
"The problem is not consistent, but happens about 90% of the time.  I
don't see any pattern to it."

It happens zero times here on many platforms (windows, linux, osx). What is FC2? Fedora Core 2?
 [2007-09-03 09:03 UTC] jeffiel at 9star dot com
Yes, Fedora Core 2.

You can see the issue at this URL:
http://media.9star.com/dynamizer/test.php

To see the page's source, append a source param:
http://media.9star.com/dynamizer/test.php?source

To see the gd_info output, append a gdinfo:
http://media.9star.com/dynamizer/test.php?gdinfo
 [2007-09-03 09:40 UTC] pajoye@php.net
None of these links work.

Do you know that the last fedora core version is the seventh? Pleae update and try again or use another decent system to test.

I'm not able to reproduce your problem, no matter the OS (debian, fc6 or 7, gentoo, windows or OS X).


 [2007-09-03 10:16 UTC] jeffiel at 9star dot com
Those links work fine for me, can you tell me what error you're getting.  
Maybe you should downgrade your OS to FC2 in order to view webpages.
 [2007-09-03 10:48 UTC] pajoye@php.net
"Those links work fine for me, can you tell me what error you're getting."

Can't establish a connection. The domain name can be pinged though.

And no, the problem is on your side, not here (not even linux anyway :)


About the bug, you have to try with a decent/recent distribution, we can't support unmaintained versions.
 [2007-09-03 10:49 UTC] jani@php.net
Your configure line is bogus to begin with. You're not supposed to have the '/lib' in any path passed to configure options.
 [2007-09-03 12:10 UTC] jeffiel at 9star dot com
Alright, well, I've already got a workaround.  Thought you might like 
the bug report.

WRT the configure line, I just recompiled without the /lib's in the 
paths, and it configures just the same.
 [2007-09-03 12:34 UTC] jani@php.net
Pierre, try running the script with valgrind..I get a lot of leaks and errors about uninitialized values, etc.
 [2007-09-03 18:36 UTC] pajoye@php.net
"Pierre, try running the script with valgrind..I get a lot of leaks and
errors about uninitialized values, etc."

For the record here (once again :), the warnings are about zlib (used by libpng) and are expected, see:

http://www.zlib.net/zlib_faq.html#faq36

The bug itself was not reproduced. Please try on any other system you have (anything more recent that fc2 should do it).

 [2007-09-11 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 11:01:30 2024 UTC