php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20472 Flood Fill problem after changing to 4.3.0RC1
Submitted: 2002-11-17 22:21 UTC Modified: 2002-12-17 23:05 UTC
From: smseidl at worldnet dot att dot net Assigned:
Status: Closed Package: GD related
PHP Version: 4.3.0RC1/3 OS: RedHat Linx 7.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: smseidl at worldnet dot att dot net
New email:
PHP Version: OS:

 

 [2002-11-17 22:21 UTC] smseidl at worldnet dot att dot net
I have recently configured my system to run 2 versions of php & Apache... one stable (php 4.2.3, and apache 1.3.27) and one development (php 4.3.0RC1 and apache 2.0.43).  When I run a script on the dev version, the image results are extremely different than when I run the same script on the stable configuration.

I am running version 1.8.4 of GD Graphics Library.  The image is created by openning a blank copy of the image, and then FloodFilling sections of the image based upon a status in a database.

The different results can be seen by going to:
http://www.wisnowmobileclubs.com/refresh.php and then
http://www.wisnowmobileclubs.com/Wisconsin.jpeg for the correct image.

For the incorrect image, go to (different port is for dev configuration):
http://www.wisnowmobileclubs.com:88/refresh.php and
http://www.wisnowmobileclubs.com:88/Wisconsin.jpeg
(Note: Please ensure the pages are not being loaded from the Cache.)

My configure command is:
'./configure' '--with-mysql' '--with-apxs2=/usr/dev/local/apache2/bin/apxs' '--with-gd' '--with-zlib-dir=/addins/zlib-1.1.3/' '--with-jpeg-dir=/usr/src/jpeg-6b/' '--prefix=/usr/dev/local/php4.3' 

Thanks

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-17 22:28 UTC] sniper@php.net
I must be blind or something, but for me both the images look exactly the same..can you please explain what the exact difference is??

 [2002-11-17 22:38 UTC] smseidl at worldnet dot att dot net
The image created by the stable version has a white background and 2 counties in Green.  The image created by the development version has a red background and only one county in green.

Please go to http://www.wisnowmobileclubs.com/picture.htm to see the two images that I see.

Thanks
 [2002-11-17 23:50 UTC] sniper@php.net
When you use --with-gd (without any path) then PHP use the bundled GD 2.0.x library. Please try adding the install prefix for your GD 1.8.4 installation.

But this might still be nice to fix in our bundled GD library. Can you possibly try the latest GD library from
http://www.boutell.com/gd/ (gd 2.0.7) to see if it works any better?

And if possible, provide a short example script which can be used to reproduce this bug.

 [2002-11-18 21:23 UTC] smseidl at worldnet dot att dot net
I will work at upgrading to the new version of GD, and try providing the path directly, rather than just the --with-gd.

Also, the links I placed in the first post were intended to be the 'script' for you to see the results for your self.  These pages are working for me, but there are times where I have to hold the control key and hit refresh to see the image change.  Since it is the same image name, the browser wants to load it from the cache, rather than re-downloading.  Please try again, and let me know if you still have problems.  

I will post back after trying your suggestions.
 [2002-11-18 22:36 UTC] smseidl at worldnet dot att dot net
After Compiling GD 2.0.7 and recompiling php & restarting apache, I get the following errors in the apache log file:
libpng warning: Application  is  running with png.c from libpng-1.0.14
gd-png:  fatal libpng error: Incompatible libpng version in application and library
[Mon Nov 18 22:34:45 2002] [notice] child pid 3197 exit signal Segmentation fault (11)

Config for PHP:
./configure  --with-mysql --with-apxs2=/usr/dev/local/apache2/bin/apxs --with-gd=/usr/dev/local/gd2.0.7/ --prefix=/usr/dev/local/php4.3/

Config for GD:
./configure --prefix=/usr/dev/local/gd2.0.7 --with-png=/usr/src/libpng-1.2.1/ --with-jpeg=/usr/src/jpeg-6b/

Any ideas?
 [2002-11-18 23:22 UTC] sniper@php.net
Isn't that error quite self-explaining??????
You should tell PHP to use same PNG library as you used
with GD. --with-png-dir should point to same place as you
used with GD..

 [2002-11-20 22:42 UTC] smseidl at worldnet dot att dot net
I have attemped to compile both PHP and GD, with specifing the same location of the libpng library in each.  After doing this I am still receiving the same error.  

I will continue to attempt different compile methods.  An update here later. 

The frequency of my responses will decrease over the next two weeks as I will be away from home.  I will continue to update more often again on Dec 2.
 [2002-12-03 21:15 UTC] paj at pearfr dot org
<I will work at upgrading to the new version of GD, and try providing the
path directly, rather than just the --with-gd.>

Can you try with only "--with-gd", you do not need to provide a path here, with the 4.3.0 or cvs, php will use the bundled (deliver with php sources) gd version. Btw, be sure to remove all include files from gd if they are in the stantard include path.

thank's 

pierre
 [2002-12-03 21:24 UTC] smseidl at worldnet dot att dot net
I apologize for the lack of updates lately, but I have been traveling for the last week and a half.  The server I am running is not at my house but at a friends who has Road Runner.  For the last 2 months it has worked without issue... of course as soon as my friend goes on vacation for 2 weeks, the ethernet card lost it's connection.

Because of that it will likely be another 2 weeks before I can look at this again.

Thanks for your help & Patience
Scott
 [2002-12-15 13:20 UTC] smseidl at worldnet dot att dot net
Hello again,

I have gotten my box back online and am working to upgrade everything to the most recent version.  I have downloaded PHP 4.3.0RC3 and GD2.0.9.  

I am able to install GD, but the PHP make fails on GD related items.  Below is my config command, and the make error.  Adding the paths to the jpeg files & libpng have not helped either.

 ./configure  --with-mysql --with-apxs2=/usr/dev/local/apache2/bin/apxs --with-gd=/usr/dev/local/gd2.0.9/ --prefix=/usr/dev/local/php4.3/

make
/bin/sh libtool --silent --mode=compile gcc  -Iext/ctype/ -I/usr/dev/src/php-4.3.0RC3/ext/ctype/ -DPHP_ATOM_INC -I/usr/dev/src/php-4.3.0RC3/include -I/usr/dev/src/php-4.3.0RC3/main -I/usr/dev/src/php-4.3.0RC3 -I/usr/dev/local/apache2/include -I/usr/dev/src/php-4.3.0RC3/Zend -I/usr/dev/local/gd2.0.9//include -I/usr/dev/src/php-4.3.0RC3/ext/xml/expat  -I/usr/dev/src/php-4.3.0RC3/TSRM  -g -O2  -prefer-pic -c /usr/dev/src/php-4.3.0RC3/ext/ctype/ctype.c -o ext/ctype/ctype.lo
/bin/sh libtool --silent --mode=compile gcc -I/usr/dev/local/gd2.0.9//include -Iext/gd/ -I/usr/dev/src/php-4.3.0RC3/ext/gd/ -DPHP_ATOM_INC -I/usr/dev/src/php-4.3.0RC3/include -I/usr/dev/src/php-4.3.0RC3/main -I/usr/dev/src/php-4.3.0RC3 -I/usr/dev/local/apache2/include -I/usr/dev/src/php-4.3.0RC3/Zend -I/usr/dev/local/gd2.0.9//include -I/usr/dev/src/php-4.3.0RC3/ext/xml/expat  -I/usr/dev/src/php-4.3.0RC3/TSRM  -g -O2  -prefer-pic -c /usr/dev/src/php-4.3.0RC3/ext/gd/gd.c -o ext/gd/gd.lo
In file included from /usr/dev/src/php-4.3.0RC3/ext/gd/gd.c:89:
/usr/dev/src/php-4.3.0RC3/ext/gd/gd_ctx.c: In function `_php_image_output_ctx':
/usr/dev/src/php-4.3.0RC3/ext/gd/gd_ctx.c:73: structure has no member named `free'
/usr/dev/src/php-4.3.0RC3/ext/gd/gd_ctx.c:105: structure has no member named `free'
/usr/dev/src/php-4.3.0RC3/ext/gd/gd.c: In function `_php_image_type':
/usr/dev/src/php-4.3.0RC3/ext/gd/gd.c:1156: structure has no member named `free'
/usr/dev/src/php-4.3.0RC3/ext/gd/gd.c:1163: structure has no member named `free'
/usr/dev/src/php-4.3.0RC3/ext/gd/gd.c: In function `_php_image_create_from':
/usr/dev/src/php-4.3.0RC3/ext/gd/gd.c:1345: structure has no member named `free'
/usr/dev/src/php-4.3.0RC3/ext/gd/gd.c:1363: warning: assignment makes pointer from integer without a cast
/usr/dev/src/php-4.3.0RC3/ext/gd/gd.c: In function `zif_imagecreatefromxpm':
/usr/dev/src/php-4.3.0RC3/ext/gd/gd.c:1433: `gdImageCreateFromXpm' undeclared (first use in this function)
/usr/dev/src/php-4.3.0RC3/ext/gd/gd.c:1433: (Each undeclared identifier is reported only once
/usr/dev/src/php-4.3.0RC3/ext/gd/gd.c:1433: for each function it appears in.)
make: *** [ext/gd/gd.lo] Error 1
 [2002-12-15 13:22 UTC] derick@php.net
This was recently fixed, can you please try a stable snapshot from snaps.php.net to verify this? We would also welcome feedback whether you encounter the same problems when using the bundled GD. (You can use that by just using --with-gd instead of --with-gd=/path).

regards,
Derick
 [2002-12-15 14:19 UTC] smseidl at worldnet dot att dot net
Can you explain how the --with-gd differs from the --with-gd=path?  I am currently have 2 versions of GD installed (gd-1.8.4 in production & 2.0.9 in dev).  Which version would the with-gd use?

I am trying a new download from snaps.php.net, and will update later today.
 [2002-12-15 14:24 UTC] iliaa@php.net
--with-gd uses bundled GD library.
 [2002-12-15 14:26 UTC] derick@php.net
--with-gd=/path uses an external library you already have installed on your system.

--with-gd will use the bundled version of GD; from PHP 4.3.0 we bundle GD with our own patches and bugfixes. If you do not need GIF writing support we strongly recommend to use the bundled library as it has some fixes and new features (like anti-aliased line drawing) that the non-bundled library does not have.
 [2002-12-15 15:28 UTC] smseidl at worldnet dot att dot net
Using the --with-gd & --with-zlib did allow PHP-4.3.0RC3 to compile & make correctly.  My code, which does work in production, does not work with this combination.  I receive the following error:
Fatal error: Call to undefined function: imagejpeg() in /home/wisnowmobileclubs.com/func/reportedplace.fun on line 368

I am still going to work with the most recent stable version & the --with-gd=path option.
 [2002-12-15 15:31 UTC] derick@php.net
You can 'fix' that problem by adding --with-jpeg-dir=/usr
(if libjpeg is located in /usr/lib and the include files in /usr/include). 
 [2002-12-15 16:01 UTC] smseidl at worldnet dot att dot net
Well, I have gotten everything to compile & make with using the --with-gd option. 

But I am still having a problem with the flood fill.  With PHP 4.2.3 the flood fill works fine... with the new versions of PHP the flood fill does not work.  I will try to create a script that can reproduce this.

http://www.wisnowmobileclubs.com/picture.htm show the differences in the images.
 [2002-12-15 16:12 UTC] smseidl at worldnet dot att dot net
To see the results of the different installations, please execute these pages.  You may need to do a full refresh (Ctrl-Refresh)

http://www.wisnowmobileclubs.com:88/refresh.php for Dev.
http://www.wisnowmobileclubs.com/refresh.php for Prod.
 [2002-12-16 19:59 UTC] pajoye@php.net
Hello,

Can you provide the original image (in the original format) ?

I saw little difference (well I expect differences while analyzing the 2 results).

pierre
 [2002-12-17 21:51 UTC] smseidl at worldnet dot att dot net
I have updated the script to output the orginial image below the php edited image.

The differences in the 2 images is the back ground.  The back ground should be white, not red as seen in the image created with this link.

http://www.wisnowmobileclubs.com:88/refresh.php

I have been able to re-create this problem by running the two different scripts on both IE 6 and Netscape 6.

If the images look the same, please do a full refresh of each page to force pull the image from the server rather than cache.

Thanks
 [2002-12-17 22:33 UTC] pajoye@php.net
Hello,

After a little test of imagefill, I can say it works as expected.

We can invoke the bad quality of the original images (lines and noises) as a reason for this problem.

I m waiting feedbacks for a final test with a clean & well formed images before closing (I hope :) this bug

pierre
 [2002-12-17 23:04 UTC] smseidl at worldnet dot att dot net
I have changed my image in a couple places to ensure that there was a solid line around the area I was issuing the flood fill.  This has fixed the problem with the flood fill filling areas that I did not intend to be filled.

Although the problem no-longer appears to be with the flood fill, I am curious at to why the two versions of php work differently.  Was something changed in php (or the bundled gd) to require a more 'solid' line?  Could this be a bug, or a un-intended side effect?

Thanks for all the help that has been provided.
 [2002-12-17 23:05 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. 

Thank you for your interest in PHP.

Not a clean image and non closed lines caused this problem.

Thank's for your report, and do not forget to use only the bundled in the futur ;-)

pierre
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 02:01:29 2024 UTC