ID:               43508
 Updated by:       [EMAIL PROTECTED]
 Reported By:      vbhunt at silverfox dot com
 Status:           Feedback
 Bug Type:         GD related
 Operating System: Windows XP Professional Ver 2SP2
 PHP Version:      5.2.5
 Assigned To:      pajoye
 New Comment:

None of the images work, please provide a link to existing images.


Previous Comments:
------------------------------------------------------------------------

[2008-11-02 13:20:04] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/



------------------------------------------------------------------------

[2007-12-06 06:50:35] vbhunt at silverfox dot com

function tinyTranspng( $filename )
{
  $rsc = imagecreatefrompng( $filename );
  if ( $rsc )
  {
    $tpColor = imagecolortransparent($rsc);
    $msg = "<p align='center' > " . $filename  . ( ($tpColor == -1 ) ?
           " HAS NO TRANSPARENCY.&nbsp" : " has transparency!&nbsp" );
  }
  else
    $msg = "<p > " . $filename . " is not a png file.";
  echo $msg;
  echo "<img src='$filename' border=0 > </p>\n";
}

http://www.republiclocomotiveworks.com/buttons/test.php runs the tests
on our current web site.  This test page generates a call to the above
php function for each of the icons in /buttons/icons.
  
The url for each of png icon files is at:

http://www.repbuliclocomotiveworks.com/buttons/icons/<filename>.png

where <filename> is one of:

alert, group, home, left, mail, right, send, stop, stop1, trash, user.

Note that RepublicLocomotiveWorks is not yet running PHP 5.2.5 -- we
are preparing to upgrade.  

Regards and thanks for looking at this issue.
/bruce

------------------------------------------------------------------------

[2007-12-05 22:09:31] [EMAIL PROTECTED]

Please provide a small script. In your case, open a png, check the
transparent color.

I also need the images you use for your tests. Please provide a link to
them.

------------------------------------------------------------------------

[2007-12-05 20:13:30] vbhunt at silverfox dot com

Description:
------------
I want to overlay an icon on a button image.  The icon is a 32 x 32
pixel png file with transparency. Icon was built in Photoshop 7.01 and
tested for transparency on FireFox 2.0.0.11 and IE 7.0.5730.13. The
button image is a jpeg.  I expected the Icon to overlay part of the jpeg
image showing through the transparent png pixels as they do in IE and
FF.  Instead, the pixels are turned white.  I have written and tested
the following simple script that reproduces the bug on my system.  I
expect the script to report the transparent color if there is one.  

This bug has been reported previously as 12619 which was dismissed as
"bogus" but notes that if you have additional information, submit it. 
 
When I attempted to comment on it (upon invitation) I get the message,
"You can not comment bogus reports or change their status."  Therefore
I'm re-submitting this ;-)

Reproduce code:
---------------
<?php
function testTransparency( $filename )
{ error_log( "Entering testTransparency." );
  $rsc = null;
  if ( $ext = pathinfo($filename,PATHINFO_EXTENSION) ) // if an image
    switch( strtolower( $ext ) )
    { case "gif" : $rsc=imagecreatefromgif( $filename ); break;              
case "png" : $rsc=imagecreatefrompng( $filename ); break;
      case "jpg" : $rsc=imagecreatefromjpeg( $filename ); break;
    }
  if ( $rsc )
  { $tpColor = imagecolortransparent($rsc);
    $trueColor=(imageistruecolor($rsc))? 'true color':'indexed color';
    if ( $tpColor == -1 ) $tpColorString = 'no transparency';
    else
    { $tpColor=(imageistruecolor($rsc))?$tpColor 
              : imagecolorsforindex($rsc, $tpColor);
      $red = ($tpColor>>16)&0xFF; $green = ($tpColor >>8)&0xFF;
      $blue = ($tpColor>>00)&0xFF;
      $tpColorString = 'transparency color: Red=' 
                     . dechex($red) . ' Green='. dechex($green) 
                     . ' Blue=' . dechex($blue) . ' ';
    }
    error_log("$filename $trueColor image has $tpColorString.");
    imagedestroy($rsc);
  }
  else error_log(" $filename is not a supported image.");
}
?>

Expected result:
----------------
I expected to see:

[05-Dec-2007 11:11:09] Entering testTransparency.

[05-Dec-2007 11:11:09] buttons/icons/stop1.png true color image has
transparency color: Red=0xFF Green=0xFF Blue=0xFF

but I got:

[05-Dec-2007 11:11:09] Entering testTransparency.

[05-Dec-2007 11:11:09] buttons/icons/stop1.png true color image has no
transparency.

I've tested this on 10 different png icon files with the same result.
All of these icons display with correct transparency in Firefox and IE
as reported above.


Actual result:
--------------
[05-Dec-2007 11:52:36] Entering testTransparency.
[05-Dec-2007 11:52:36] buttons/icons/alert.png true color image has no
transparency.

[05-Dec-2007 11:52:36] Entering testTransparency.
[05-Dec-2007 11:52:36] buttons/icons/home.png true color image has no
transparency.

The tests below actually do not have transparency.
[05-Dec-2007 11:52:36] Entering testTransparency.

[05-Dec-2007 11:52:36] buttons/images/hotmaples1_1.gif indexed color
image has no transparency.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43508&edit=1

Reply via email to