Für alle die es interesiert das ist die Lösung...
PHP-Code:
<?php
$this->_resized = @imagecreatetruecolor($newWidth, $newHeight);
imageantialias($this->_resized, true);
if ($this->_info['mime'] == "image/gif" OR $this->_info['mime'] == "image/png")
{
// Transparente Farbe des Quell-Bildes abfragen
$colorTransparent = imagecolortransparent($this->_img);
// Parlette kopieren
$this->_imagepalettecopy_exact();
// Zielbild mit transparenter Farbe füllen
imagefill($this->_resized,0,0,$colorTransparent);
// Die Füllfarbe als transparent deklarieren
imagecolortransparent($this->_resized, $colorTransparent);
imagecopyresized($this->_resized, $this->_img, 0, 0, 0, 0, $newWidth, $newHeight, $this->_info['width'], $this->_info['height']);
}
else
{
imagecopyresampled($this->_resized, $this->_img, 0, 0, 0, 0, $newWidth, $newHeight, $this->_info['width'], $this->_info['height']);
}
}
protected function _imagepalettecopy_exact() {
for( $c = 0 ; $c < imagecolorstotal($this->_img); $c++) {
$col = imagecolorsforindex($this->_img, $c); //get color at index 'c' in the color table
imagecolorset($this->_resized, $c, $col['red'], $col['green'], $col['blue']); //set color at index 'c' to $col in the $dst_image
}
}?>
Mir ist dabei aufgefallen das imagecopyresampled bei transparenten Gif's Müll produziert aber imagecopyresized funktioniert problemlos.