Project

General

Profile

Actions

Bug #23236

closed

Generation transparent images with GMENU fails

Added by Marius Muehlberger almost 14 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2010-07-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

After updating from TYPO3 4.3.X (everything works fine) - the images generated via GMENU are not transparent any more.
Does not work in 4.4.0, changing back to 4.3.X everything is fine again.

ImageMagick Version is 4.2.9.

Example-Code:

lib.nav.main.1 {
NO = 1
NO {
XY = [30.w]+30, 31
format = gif
backColor = #000000
transparentColor = #000000 ## no effect (works in 4.3.X, not in 4.4.0):
#transparentColor.closest = 1 ## use instead transparentColor of no effect (works in 4.3.X, not in 4.4.0):
#transparentBackground = 1

wrap= |
10 = IMAGE
10 {
file = fileadmin/tpl/menu/nact-back.b.gif
align = l,t
}
30 = TEXT
30 {
text.field = title
fontColor = #ffffff
fontFile = fileadmin/tpl/menu/myfont.ttf
fontSize = 12
offset = 0 , 22
align = center
niceText = 0
}
}

(issue imported from #M15184)


Files

15184.diff (776 Bytes) 15184.diff Administrator Admin, 2010-11-02 16:41
Actions #1

Updated by Torben Hansen almost 14 years ago

I can confirm this bug.

In TYPO3 4.4 the function "makeText" in class.t3lib_stdgraphic.php was modified, so images are created with the function "imagecreatetruecolor". When I change this back to "imagecreate", everything works fine again.

Tested with GM 1.1.6, GM 1.1.11, ImageMagick 4.2.9 and ImageMagic 6 on Debian Lenny systems.

Actions #2

Updated by over 13 years ago

Thanks for this research, Torben. I have the same problem. In <= 4.4, a GIFBUILDER graphic with niceText = 1 and transparentBackground = 1 had #FAFCFA as "transparent" which is pretty close to #FFFFFF.

In 4.4 with same configuration "transparent" is #FAFCFA which is clearly different from #FFFFFF.

Actions #3

Updated by Marius Muehlberger over 13 years ago

In my testcase turning niceText on or off does not influence the problem (neither reduceColors, but this feature is deprecated/obsolete anyway).

Also using black or white as transparent color (which often remain #ffffff or #000000) does not help to solve the problem.
Output color in the example TS above really is #000000, but the image created only is transparent in TYPO3 4.3

Actions #4

Updated by over 13 years ago

In my system, turning niceText off and antiAlias on (which is on by default), the background is #FFFFFF. But niceText off has the best rendering result with the font size I'm using.

Actions #5

Updated by Marius Muehlberger over 13 years ago

Just tried out: The bug remains in 4.4.1 :(

Actions #6

Updated by over 13 years ago

I doubt that it's a bug, it's just an inconvinience... the change was done with #22687. GD1 support was dropped so True Color images are now generated by default.

And by the way, it's mentioned in TSref that transparentBackground and niceText may not work together properly ("NOTE: You may experience that this doesn't work if you use reduceColors-option or render text with niceText-option.")

Still I wonder if it's really impossible to have a white background in a niceText image.

Actions #7

Updated by Marius Muehlberger over 13 years ago

I read this note before creating this bug. I have turned of niceText and still only get transparent images in T3 v. 4.3

30 = TEXT
30 {
[...]
niceText = 0
}

Actions #8

Updated by Torben Hansen over 13 years ago

I finally figured this out.

It seems, that TYPO3 4.4 canĀ“t create transparent GIF-images using the Gifbuilder.

When I configure TYPO3 to create PNG-images instead of GIF-images, the transparency of Gifbuilder-Images works fine again.

Set the following in your localconf.php

[GFX][gdlib_png] = 1

Hope this helps.

Actions #9

Updated by Marius Muehlberger over 13 years ago

Thanks for that hint! But it still remains a bug, creating gif's should be possible anyway - using png's is not a solution.
Internet Explorer 6 does not support transparent png's and the sad thing is that 7% of our visitors still use this dinosaur...

Actions #10

Updated by dermueller no-lastname-given over 13 years ago

I can confirm this bug with TYPO3 4.4.

Actions #11

Updated by J. Peter M. Schuler over 13 years ago

Confirmed for TYPO3 4.4.2 and ImageMagick 6.3.7.
Confirmed for tranparentColor and for transparentBackground.

Adding "format = png" (or the GFX var as Torben said) generates transparent PNGs as expected, GIFs just get a solid black (although the backColor is some blue) background.

Actions #12

Updated by Marius Muehlberger over 13 years ago

Changing a flag - which at the first glance has nothing todo with gif-generation - solved the problem for me:

$TYPO3_CONF_VARS['GFX']['png_truecolor'] = '1'
(default is 0)

Could confirm this on two installations so far; Don't forget to clean up typo3temp/menu and cached image sizes via install tool.

Transparent gif's are back :)
Problem solved? Can anyone confirm this manner?

Actions #13

Updated by Torben Hansen over 13 years ago

When I just enable PNG Truecolor as Marius wrote, GIF-Images are still not rendered with transparent background. I have tested this on several (existing) installations, cleaned all caches and deleted alle temp-files in typo3temp/

Actions #14

Updated by over 13 years ago

In my opinion it can only work (and it does!) when

[GFX][gdlib_png] = 1 AND
[GFX][png_truecolor] = 1

are enabled. With these configs I finally got transparent headers/menus back.

Actions #15

Updated by Marius Muehlberger over 13 years ago

In my case it is:

[GFX][gdlib_png] = 0
[GFX][png_truecolor] = 1

because I need a transparent GIF output!
[GFX][gdlib_png] = 1
would disable GIF-output.

If you need an example send me a message: mm (at) co-operation (dot) de

Actions #16

Updated by Mathias Schreiber over 13 years ago

Solution is much more simple:

Benni changed the way T3LIB_StdGraphic handles files internally to truecolor some time back.
GIFBUILDER uses ImageColorExact to determine the transparent color value which is only available in images that use palettes (which trueColor do not).

See attachted patch for fixing the stuff

Actions #17

Updated by Marius Muehlberger over 13 years ago

This explanation makes sence. Although the other way worked in several installations for me. Will the patch be included in new versions?

Actions #18

Updated by Mathias Schreiber over 13 years ago

pending in core list... le'ts wait and see :)

Actions #19

Updated by Ernesto Baschny over 13 years ago

The fix by Mathias Schreiber was committed this to:

- trunk rev 9316 (will be in 4.5.0 beta1)
- TYPO3_4-4 rev 9317 (will be in 4.4.5)

Actions #20

Updated by Ernesto Baschny almost 11 years ago

  • Target version deleted (1088)
Actions #21

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF