Bug #37060

GIF with transparant background turns black

Added by Dennis Hoffland over 7 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Image Cropping
Target version:
-
Start date:
2012-05-10
Due date:
% Done:

0%

TYPO3 Version:
4.7
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I have a GMENU on my website with .gif images as button backgrounds. The original .gif files have a transparant background. When rendered the background turns black. When replaced by .gif images with a coloured background the rendering is normal again.

My hosting details:

PHP 5.3.2-1ubuntu4.15
ImageMagick 6.5.7-8

57f2836b2d.png View - generated image with black background (943 Bytes) Mario Rimann, 2012-06-01 13:19

e59a7778f1.png View - generated image with proper background image shown (2.71 KB) Mario Rimann, 2012-06-01 13:19

issue37060_typoscript.txt View - TS testcase (664 Bytes) Mario Rimann, 2012-06-01 13:19


Related issues

Related to TYPO3 Core - Bug #36947: GIFBUILDER render twice Closed 2012-05-08

History

#1 Updated by Florian Zimmermann over 7 years ago

i have the same prob first.
You need an inverted Mask, see Wiki article http://wiki.typo3.org/GIFBUILDER.
And also try the two localconf.php properties
$TYPO3_CONF_VARS['GFX']['im_negate_mask'] = '1';
$TYPO3_CONF_VARS['GFX']['im_imvMaskState'] = '1';
Please check after you have create this mask and your gifbuilder runs normal again my bug http://forge.typo3.org/issues/36947

#2 Updated by Raphael Zschorsch over 7 years ago

I have the same problem with TYPO3 version 4.7.0 and GIFBUILDER, although not with a gif-file but with a png-file which has semi-transparency. colors of the mask are rendered correctly, but everything which is transparent or semi-transparent is rendered black. I tried various settings in the Install Tool and found nothing that worked (as the problem seems to have existed before). The negate mask didn't help either. I use version 6.7.5-3 of ImageMagick. I have the same ImageMagick version with a TYPO3 4.4.4 and there it's working fine with no special Install Tool configuration or anything.

#3 Updated by Florian Zimmermann over 7 years ago

Hi,
have you empty the typo3temp/GB and typ3temp/pic dir before you try to render the images again?
I could also be fixed with the fix from my reported bug. Here everthing runs fine now again.

#4 Updated by Gernot Ploiner over 7 years ago

I think i have the same Problem with TYPO3 4.7 on different servers.
When i generate an Image with GIFBUILDER and merge more than one Image together, than appears a black Image.

#5 Updated by Philipp Mueller about 7 years ago

Hello

I have the same problem when I try to place a semi-transparent PNG. On TYPO3 4.6.8 it's everything okay. The problem is only in TYPO3 4.7.

  • TYPO3 4.7.0
  • GraphicsMagick 1.3.12 2010-03-08 Q8
  • PHP Version 5.3.3-7+squeeze9

#6 Updated by Mario Rimann about 7 years ago

We see this problem, too. Please see attached a small Typoscript Testcase to demonstrate the problem. It generates two images that consist of multiple layers:

  • a background image (GIF, PNG -> doesn't matter, tested both)
  • a layer that draws a white line at the bottom of the image
  • a text layer

Removing the layer in the middle solves the problem for us. The two generated images are attached, too.

Tested with TYPO3 v4.7.1 on a Ubuntu 10.04 box, PHP 5.3.2-1ubuntu4.15

#7 Updated by Mario Rimann about 7 years ago

I tested the proposed change in t3lib_stdgraphic from Florian Zimmermann that he posted to #36947 (see http://forge.typo3.org/issues/36947#note-4).

It's a three characters change that works and solves the problem as outlined above. After applying the fix to the PHP code, the attached TS testcase then renders a proper image also for the first one (manual clearing of the generated images is required before testing!)

Alltough I could propose a patch to Gerrit, I'm absolutely unsure on the impact of the proposed change. If someone that knows that class and it's functionality better could review the change and get this fixed, this would be highly appreciated!

#8 Updated by Lorenz Ulrich about 7 years ago

@ Mario Rimann: #36947 was only a regression from refactoring. It's in Gerrit now and already has enough +1s, so I think it will be merged soon.

#9 Updated by matthias scheib over 6 years ago

an easy way to to solve the problem for ai/pdfs with transparency that turns the transparent background into black
(Install > Image Processing > Reading image formats > Read AI -> black border around the server-image)

is to add the following options in "All Configuration":

[GFX][im_stripProfileCommand] = +profile '*' -background white -flatten

#10 Updated by BENCH Artwork over 6 years ago

matthias scheib wrote:

an easy way to to solve the problem for ai/pdfs with transparency that turns the transparent background into black
(Install > Image Processing > Reading image formats > Read AI -> black border around the server-image)

is to add the following options in "All Configuration":

[GFX][im_stripProfileCommand] = +profile '*' -background white -flatten

The im_stripProfileCommand will "fix" the problem with transparent PDF. But after that, i can't upload anymore transparent gif/png for a content element.
is there a way to just apply this command to pdfs?

#11 Updated by Susanne Moog about 5 years ago

  • Status changed from New to Needs Feedback
  • Is Regression set to No

Hi,

some background:

Transparent turns black unless you specify a different color because transparent = unset color = 0 = black.

The GIFBUILDER should not have this problem anymore as it handles the image conversion different now - if you still have the problem please add a minimal example of the typoscript to reproduce this.

Cheers,

susi

#12 Updated by Alexander Opitz over 4 years ago

  • Status changed from Needs Feedback to Closed
  • Target version deleted (4.7.1)

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Also available in: Atom PDF