ID:               22323
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jukkaho at mail dot student dot oulu dot fi
-Status:           Open
+Status:           Assigned
 Bug Type:         GD related
 Operating System: Linux
 PHP Version:      4.3.0
-Assigned To:      
+Assigned To:      pajoye


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

[2003-02-20 23:49:14] jukkaho at mail dot student dot oulu dot fi

I have submitted a proposed patch to the development mailing list (see
http://marc.theaimsgroup.com/?l=php-dev&m=104577317709538&w=2). When
everything's ok in cvs snapshot, this bug is closed.

There's no state 'should be fixed in cvs' so this stays open. :)

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

[2003-02-20 08:13:55] jukkaho at mail dot student dot oulu dot fi

Relevant parts are not changed in CVS so there are still no way to call
gdImageSaveAlpha() with a true argument so that alpha channel is
actually sent to browser.

Default value is still set to 0 and has the following comment:

/* 2.0.2:
   alpha blending is now on by default, and saving of 
   alpha is off by default. This allows font 
   antialiasing to work as expected on the first try 
   in JPEGs -- quite important -- and also allows
   for smaller PNGs when saving of alpha channel is 
   not really desired, which it usually isn't! */

im->saveAlphaFlag = 0;

In my case it really is desired. I want to be able to produce
transparent PNGs. I just don't have access in PHP to change
saveAlphaFlag value.

Someone could just create a new PHP image function
ImageSaveAlpha($im,$bool) that passes that info to gdImageSaveAlpha
(gdImagePtr im, int saveAlphaArg);

I have solved my blending problems already by using undocumented
functions as I have described in bug #22327.

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

[2003-02-20 07:30:49] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

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

[2003-02-20 04:24:57] jukkaho at mail dot student dot oulu dot fi

Alpha channel in a truecolor image is only sent when im->saveAlphaFlag
is true.

It is by default set to false in gdImageCreateTrueColor() and there are
no callers to gdImageSaveAlpha() to set it to any other value.

I tested a hack where I call gdImageSaveAlpha() in
PHP_FUNCTION(imagealphablending) and it worked mostly as expected. I'd
guess that another function call is needed unless is it made to default
behaviour and calls are embedded in PHP_FUNCTION(imagepng) etc.

Only weird things that occured were that for some reason, target image
alpha channel is discarded when blending other images to it.

For example when blending fully transparent part over another fully
transparent part resulted in a white area. White comes from destination
image that's transparent too.

Maybe I should open another bug for it?

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


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

Reply via email to