Project

General

Profile

Bug #15726 ยป gifbuilder_transparency_2006-03-09.diff

Administrator Admin, 2006-03-09 03:46

View differences:

typo3_src-4.0beta3.gifbuilder/t3lib/class.t3lib_stdgraphic.php 2006-03-09 03:45:03.150302424 +0100
case 'png':
if ($this->ImageWrite($this->im, $file)) {
// ImageMagick operations
if ($this->setup['reduceColors'] || !$this->png_truecolor) {
if ($this->setup['reduceColors'] || (!$this->png_truecolor && $this->truecolor)) {
$reduced = $this->IMreduceColors($file, t3lib_div::intInRange($this->setup['reduceColors'], 256, $this->truecolorColors, 256));
if ($reduced) {
@copy($reduced, $file);
typo3_src-4.0beta3.gifbuilder/typo3/sysext/cms/tslib/class.tslib_gifbuilder.php 2006-03-09 03:12:22.499366672 +0100
}
if (!$this->setup['backColor']) { $this->setup['backColor']='white'; }
// Transparent GIFs
// not working with reduceColors
// there's an option for IM: -transparent colors
if ($conf['transparentColor.'] || $conf['transparentColor']) {
$cObj =t3lib_div::makeInstance('tslib_cObj');
$cObj->start($this->data);
$this->setup['transparentColor_array'] = explode('|', trim($cObj->stdWrap($this->setup['transparentColor'], $this->setup['transparentColor.'])));
}
// 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;
}
// Set default dimensions
if (!$this->setup['XY']) {$this->setup['XY']='120,50';}
......
} elseif (is_array($this->setup['transparentColor_array'])) {
// Multiple transparent colors are set. This is done via the trick that all transparent colors get converted to one color and then this one gets set as transparent as png/gif can just have one transparent color.
$Tcolor = $this->unifyColors($this->im, $this->setup['transparentColor_array'], intval($this->setup['transparentColor.']['closest']));
if ($Tcolor) {
if ($Tcolor>=0) {
imagecolortransparent($this->im, $Tcolor);
}
}
    (1-1/1)