php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21624 no transparent Colors in PNG's with Opera 6/7
Submitted: 2003-01-13 15:33 UTC Modified: 2003-01-14 04:27 UTC
From: Jones at partykel dot de Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.3.0 OS: RedHat
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: Jones at partykel dot de
New email:
PHP Version: OS:

 

 [2003-01-13 15:33 UTC] Jones at partykel dot de
If I generate a PNG with PHP 4.3.0, GD and libpng 1.2.5 and try to use a transparent color with imagecolortransparent(), that doesn't work in Opera (I've tested with Versions 6 & 7).
Sometimes simply nothing happens and sometimes another color is set as transparent.
In Mozilla, everything works fine.

With the previous Version of PHP and GD 1.8.4 and libpng 1.2.4 it worked in Opera.

My configure line:
./configure --with-apxs=/usr/local/apache/bin/apxs --with-freetype-dir=/usr/local/include --with-jpeg-dir=/var/install/php/jpeg-6b --with-png-dir --enable-track-vars --enable-ftp --with-zlib --with-gd --with-sockets --enable-sockets --with-sysvshm --with-sysvsem --disable-debug --with-mysql=/usr

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-13 16:20 UTC] iliaa@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.

Given that the behaviour is incositent across browsers and I cannot replicate the described problem in Mozilla or IE 6.0 I'd say this is a broser and not a PHP issue. Perpahps, Opera cannot handle alpha transparency, which is what is causing the problem, this particular type of transparency would not have been avaliable in older GD library.
 [2003-01-13 16:36 UTC] Jones at partykel dot de
Since Version 6.0 Beta 1 Opera fully supports alpha transparency:
http://www.opera.com/windows/changelogs/600b1/index.dml

So because it worked in previous PHP/GD-versions, I think it is a PHP issue
 [2003-01-13 16:38 UTC] rasmus@php.net
It is a PHP issue.  A patch was posted to php-dev a while ago, but nobody has had a chance to look at it yet.
 [2003-01-13 16:39 UTC] iliaa@php.net
PHP generates the very same image for every browser. If it works in 2 browsers and does not work in one, is it not reasonable to assume that the browser where the image does not work is the one at fault?
 [2003-01-13 16:40 UTC] rasmus@php.net
No, because the very same script works fine with previous versions of PHP.  Just because a browser is able to decypher the broken images we generate doesn't mean we are doing it right.
 [2003-01-13 17:05 UTC] Jones at partykel dot de
Is there the prospect of a soon bugfix for this problem?
Because downgrading to an older version would be a very bad solution...
 [2003-01-13 17:18 UTC] iliaa@php.net
Could you please provide a short example of thew script that can be used to duplicate the problem.
 [2003-01-13 17:18 UTC] rasmus@php.net
No, not really.  It's a rather low-priority problem.
 [2003-01-13 17:21 UTC] nicos@php.net
Still waiting for feedback.
 [2003-01-13 17:23 UTC] Jones at partykel dot de
iliaa:

<?
	header('Content-type: image/png');
	$Image = imagecreate(300,150);
	$Body = imagecolorallocate($Image,222,222,222);
	$Char = imagecolorallocate($Image,10,36,106);
	imagecolortransparent($Image,$Char);
	imagechar($Image,5,100,50,"P",$Char);
	imagepng($Image);
?>

rasmus: yeah but I think this problem perhaps only DOESN'T appear with IE & Mozilla but with most other browsers...
 [2003-01-13 17:26 UTC] rasmus@php.net
Sure, but "most other browsers" make up a very very small percentage of what people use.

Anyway, a potential patch for this was posted a couple of weeks ago.  Try the code referenced in the article below and let us know if it fixes it:

http://news.php.net/article.php?group=php.dev&article=93058
 [2003-01-13 17:54 UTC] iliaa@php.net
The example script works perfectly with: Konqueror 3.0, IE 6.0, Mozilla 1.3a, IE6 and Opera 6.02 (Linux). I am using bundled GD with libpng 1.2.0.
Once I compiled libpng 1.2.5 and tried running the same script the image no longer worked in any browser.
 [2003-01-13 18:02 UTC] Jones at partykel dot de
The patch doesn't fix this problem :(

I changed the code and reconfigured/-compiled, but the example still only works correct in Mozilla.

I think the best way would be to use an older version of libpng, e.g. version 1.0.15 from http://www.libpng.org/pub/png/libpng.html, right?
 [2003-01-13 18:13 UTC] iliaa@php.net
It was my fault libpng 1.2.5 didn't work (header confusion). Once I clean the headers up the code once again worked properly. The only browser with which I can duplicate the problem is Netscape 4.7 on Linux.
 [2003-01-13 18:15 UTC] rasmus@php.net
I guess this is a different problem then than the one described by Steven Brown.
 [2003-01-13 18:37 UTC] Jones at partykel dot de
So there isn't a possibility to fix this?

iliaa: And it don't works with Opera 6/7 for Windows.
If you got to http://www.partykel.de you'll see that in IE/Mozilla, the mainmenu-buttons (generated with gd & libpng) at the top are transparent and in Opera they aren't.
 [2003-01-13 19:06 UTC] iliaa@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.

The images on the specified site work just fine for me in my Opera (6.02 Linux).

I'm marking the bug as bogus since I cannot replicate the problem, nor do I see the described problem on the specified site with 4 different browsers. Quircks of win32 Opera are surely not related to PHP.
 [2003-01-14 04:27 UTC] Jones at partykel dot de
No I don't think it's an error of Opera.

Look at the examples from the png homepage:
http://www.libpng.org/pub/png/png-sitemap.html#images
e.g.:
http://www.libpng.org/pub/png/png-IceAlpha.html
http://www.libpng.org/pub/png/png-MagnoliaAlpha.html
(this pics use alpha transparency)

Opera has no problems to show the images in the correct way.

So why the transparency generated with gd isn't shown right?
 [2003-03-03 15:51 UTC] webmaster at ragnarokonline dot de
I agree with Jones at partykel dot de.

This is a bug, that should be fixed in the next PHP Version.

And as rasmus said:
>Just because a browser is able to decypher the broken images >we generate doesn't mean we are doing it right.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 10:01:32 2024 UTC