Feature #17729 » 6604_trunk.patch
t3lib/class.t3lib_stdgraphic.php (Arbeitskopie) | ||
---|---|---|
if (is_array($colArr) && count($colArr) && function_exists('imagepng') && function_exists('imagecreatefrompng')) {
|
||
$firstCol = array_shift($colArr);
|
||
$firstColArr = $this->convertColor($firstCol);
|
||
if (count($colArr)>1) {
|
||
if (count($colArr)>1 || t3lib_div::intInRange($closest,2,99)) {
|
||
$origName = $preName = $this->randomName().'.png';
|
||
$postName = $this->randomName().'.png';
|
||
$this->imageWrite($img, $preName);
|
||
$firstCol = $this->hexColor($firstColArr);
|
||
foreach ($colArr as $transparentColor) {
|
||
$transparentColor = $this->convertColor($transparentColor);
|
||
$transparentColor = $this->hexColor($transparentColor);
|
||
$cmd = '-fill "'.$firstCol.'" -opaque "'.$transparentColor.'"';
|
||
if (count($colArr)>1) {
|
||
foreach ($colArr as $transparentColor) {
|
||
$transparentColor = $this->convertColor($transparentColor);
|
||
$transparentColor = $this->hexColor($transparentColor);
|
||
$cmd = '-fill "'.$firstCol.'" -opaque "'.$transparentColor.'"';
|
||
$this->imageMagickExec($preName, $postName, $cmd);
|
||
$preName = $postName;
|
||
}
|
||
}
|
||
if (t3lib_div::intInRange($closest,2,99)) {
|
||
$cmd = '-fuzz '.intval($closest).'% -fill "'.$firstCol.'" -opaque "'.$firstCol.'"';
|
||
$this->imageMagickExec($preName, $postName, $cmd);
|
||
$preName = $postName;
|
||
}
|
||
$this->imageMagickExec($postName, $origName, '');
|
||
if (@is_file($origName)) {
|