[TYPO3-core] RFC: GIFBUILDER transparency

Franz Holzinger franz at fholzinger.com
Fri Mar 17 08:00:13 CET 2006


Hello Bernhard,

>This is a CVS patch request.
>
>
>BT reference:
>http://bugs.typo3.org/view.php?id=2692
>http://bugs.typo3.org/view.php?id=2702
>
>
>Description:
>Some people on the newsgroups found a problem with the new GIFBUILDER code. The problem is
>that under certain conditions (Read them up in the BT notes) the transparency of GIFBUILDER
>labels (images with just text on it) was inverted (Not the background was transparent but
>the text)
>
>  
>
> -        $retCol = false;
> +        $retCol = -1;

You have changed the interface here. This can be a break in
compatibility for extensions using unifyColors.


I do not understand what $this->png_truecolor is used in this context.If
$this->png_truecolor == 0 then $this->truecolor will be deleted also for
GIFs. However from the IF above in the patch I can see that it must be
possible to have $this->truecolor==1 and $this->png_truecolor == 0 at
the same time. Or an && has to be joined with !$this->png_truecolor here.


> +                // Transparency does not properly work when, GIFs or
> 8-bit PNGs are generated or reduceColors is set -- disable truecolor
> flag so they get generated "natively" in 8-bit.
> +                // not working with reduceColors and truecolor images
> +            if (($this->setup['transparentBackground'] ||
> is_array($this->setup['transparentColor_array'])) &&
> ($this->gifExtension=='gif' || !$this->png_truecolor ||
> isset($this->setup['reduceColors'])))    {
> +                $this->truecolor = false;
> +            }




> $Bcolor = ImageColorExact($this->im, $BGcols[0],$BGcols[1],$BGcols[2]);

I have read that this would not work with pngs with more than 256 colors.
http://de.php.net/manual/fr/function.imagecolorexact.php

Maybe an if should come around it so only ImageMagick versions who have
an error here will use this extra function call.


- Franz


















More information about the TYPO3-team-core mailing list