Issue Bug Closed

#22797alpha transparency issue with png_truecolor=1

Andreas Philippi 06/03/10, 11:55 updated 10/11/13, 13:07

Description

trying to create a GIFBUILDER object that overlays 2 png24-images.

the resulting image had no alpha-transparency.

This only happens when setting [GFX][png_truecolor] = 1

Our solution was to replace line 3022 in the file t3lib/class.t3lib_stdgraphic.php as follows:

original:
return imagecreatetruecolor($w, $h);

new:
$tmpImg = imagecreatetruecolor($w, $h);
imagealphablending( $tmpImg, false );
imagesavealpha( $tmpImg, true );
return $tmpImg;

And now it works fine. Patch is attached

typo3 configs

  • [GFX][gdlib_png] = 1
  • [GFX][png_truecolor] = 1
  • [GFX][gdlib-2] = 1

excerpt from our typoscript

temp.our_image = IMAGE
temp.our_image.file = GIFBUILDER
temp.our_image.file{
XY = 243,171
transparentBackground = 1

10 = IMAGE
10.file = fileadmin/template/main/pics/img_border.png
10.file.width = 243
10.file.height = 171

20 = IMAGE
20.file.import.field = image
20.file.import = uploads/pics/
20.file.import.listNum = 0
20.file.width = 217c
20.file.height = 150
20.offset = 10,7
(issue imported from #M14602)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.