[TYPO3-core] RFC: Bugfix for Image Generation in t3lib_div

Ingo Renner ingo at typo3.org
Fri Sep 14 16:47:41 CEST 2007


Ingo Renner wrote:

> The icon get's generated now but has errors. The parts which should be 
> transparent are black now... (resulting icon attached)
> 
> It seems though that your patch basically works as the images get 
> converted to png before they get put together. (found the converted 
> icons in typo3temp, "readPG_ ... .png")
> 
> +1 for the patch so far after testing. The issue with the black 
> transparent areas is a new thing we should fix before comitting the 
> patch though.

After some debugging with the lovely xedbug+eclipse combo I found out 
that somehow that black instead of transparent background gets generated 
by PHP/GD's own function ImagePng() when called in 
t3lib_iconWorks::imagecopyresized().

This function get's called the first time to apply the user icon to the 
extension icon. The second time that function get's called to apply the 
little clock icon. When it get's called that second time imagepng() 
turns that transparent background into a black one.

There's a longer comment above t3lib_iconWorks::imagecopyresized() where 
Kasper tries to explain why it uses the way through IM instead of 
PHP/GD's native imagecopyresized().
However when forcing TYPO3 to use the native php function all works 
well. (At least on my configuration: GM, PHP 5.2.4) That's why I'd 
propose to always use PHP's native imagecopyresized() as in the patch.

To sum it up the szenario to test all this should be:
* PHP 5.1+ or 5.2+
* IM or GM
* GD2 (should be built into PHP)
* [GFX][gdlib_png] = 1 (also try 0)
* generation of a individual record icon with at least two overlay icons 
(user, time, access restricted page section, ...)
* both patches, Benni's and mine applied


Hope this is all clear

Ingo










-------------- next part --------------
A non-text attachment was scrubbed...
Name: iconRendering__gdlib_png__onAndOff.diff
Type: text/x-diff
Size: 1327 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070914/46d6dc2c/attachment.diff 


More information about the TYPO3-team-core mailing list