Bug #22797
closedalpha transparency issue with png_truecolor=1
0%
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)
Files
Updated by Jigal van Hemert over 14 years ago
14602.patch fixes this in trunk (4.5).
An extra TS option activates the alphachannel. Example code:
10 = IMAGE
10 {
wrap = <div style="background: #ddd;"> | </div>
file = GIFBUILDER
file {
XY = 100,99
format = png
alphaChannel = 1
5 = BOX
5 {
dimensions = 50,10,50,50
color = yellow
opacity = 20
}
10 = TEXT
10 {
text = TESTimg
fontSize = 24
offset = 10,40
fontColor = red
}
}
}
This creates an image with transparent background, a semi-transparent yellow box and on top red text. The grey CSS background shows the transparency of the PNG image.
Updated by Alexander Opitz over 11 years ago
- Category deleted (
Communication) - Status changed from New to Needs Feedback
- Target version deleted (
0)
The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Alexander Opitz about 11 years ago
- Is Regression set to No
No response in over 3 month so closing this issue.
If you think this issue should be reopened, then write to the bugs mailing list.
Updated by Alexander Opitz about 11 years ago
- Status changed from Needs Feedback to Closed