--- class.t3lib_stdgraphic.php.orig 2005-04-07 13:38:53.000000000 +0200 +++ class.t3lib_stdgraphic.php 2005-04-07 15:44:03.552021800 +0200 @@ -339,7 +339,10 @@ $theMask2 = $tmpStr.'_mask2.'.trim($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_mask_temp_ext_noloss']); // prepare overlay image $cpImg = $this->imageCreateFromFile($BBimage[3]); - $destImg = imagecreate($w,$h); + if ($this->GD2) + $destImg = imagecreatetruecolor($w,$h); + else + $destImg = imagecreate($w,$h); ImageColorAllocate($destImg, 0,0,0); $this->copyGifOntoGif($destImg,$cpImg,$conf,$workArea); $this->ImageGif($destImg, $theImage); @@ -347,7 +350,10 @@ imageDestroy($destImg); // prepare mask image $cpImg = $this->imageCreateFromFile($BBmask[3]); - $destImg = imagecreate($w,$h); + if ($this->GD2) + $destImg = imagecreatetruecolor($w,$h); + else + $destImg = imagecreate($w,$h); ImageColorAllocate($destImg, 0,0,0); $this->copyGifOntoGif($destImg,$cpImg,$conf,$workArea); $this->ImageGif($destImg, $theMask); @@ -580,7 +589,10 @@ $newH = ceil($sF*imagesy($im)); // Make mask - $maskImg = imagecreate($newW, $newH); + if ($this->GD2) + $maskImg = imagecreatetruecolor($newW, $newH); + else + $maskImg = imagecreate($newW, $newH); ImageColorAllocate($maskImg, 255,255,255); $Fcolor = ImageColorAllocate($maskImg, 0,0,0); if ($spacing || $wordSpacing) { // If any kind of spacing applys, we use this function: @@ -615,7 +627,10 @@ $this->imageMagickExec($fileMask,$fileMask,$command); // Make the color-file - $colorImg = imagecreate($w,$h); + if ($this->GD2) + $colorImg = imagecreatetruecolor($w,$h); + else + $colorImg = imagecreate($w,$h); ImageColorAllocate($colorImg, $cols[0],$cols[1],$cols[2]); $this->ImageGif($colorImg, $fileColor); ImageDestroy($colorImg); @@ -1260,14 +1275,20 @@ $fileMask = $tmpStr.'_mask.'.$this->gifExtension; // BlurColor Image laves - $blurColImg = imagecreate($w,$h); + if ($this->GD2) + $blurColImg = imagecreatetruecolor($w,$h); + else + $blurColImg = imagecreate($w,$h); $bcols=$this->convertColor($conf['color']); ImageColorAllocate($blurColImg, $bcols[0],$bcols[1],$bcols[2]); $this->ImageGif($blurColImg, $fileColor); ImageDestroy($blurColImg); // The mask is made: BlurTextImage - $blurTextImg = imagecreate($w+$blurBorder*2,$h+$blurBorder*2); + if ($this->GD2) + $blurTextImg = imagecreatetruecolor($w+$blurBorder*2,$h+$blurBorder*2); + else + $blurTextImg = imagecreate($w+$blurBorder*2,$h+$blurBorder*2); ImageColorAllocate($blurTextImg, 0,0,0); // black background $txtConf['fontColor'] = 'white'; $blurBordArr = Array($blurBorder,$blurBorder); @@ -1297,7 +1318,10 @@ if ($blurTextImg_tmp) { // if nothing went wrong we continue with the blurred mask // cropping the border from the mask - $blurTextImg = imagecreate($w,$h); + if ($this->GD2) + $blurTextImg = imagecreatetruecolor($w,$h); + else + $blurTextImg = imagecreate($w,$h); $this->imagecopyresized($blurTextImg, $blurTextImg_tmp, 0, 0, $blurBorder, $blurBorder, $w, $h, $w, $h); ImageDestroy($blurTextImg_tmp); // Destroy the temporary mask @@ -1469,7 +1495,7 @@ $commands.=' -flop'; break; case 'colors': - $commands.=' -colors '.t3lib_div::intInRange($value,2,255); + $commands.=' -colors '.t3lib_div::intInRange($value,2,65535); break; case 'shear': $commands.=' -shear '.t3lib_div::intInRange($value,-90,90); @@ -1528,7 +1554,10 @@ $conf['offset']=$cords[0].','.$cords[1]; $cords = $this->objPosition($conf,$this->workArea,Array($cords[2],$cords[3])); - $newIm = imagecreate($cords[2],$cords[3]); + if ($this->GD2) + $newIm = imagecreatetruecolor($cords[2],$cords[3]); + else + $newIm = imagecreate($cords[2],$cords[3]); $cols=$this->convertColor($conf['backColor']?$conf['backColor']:$this->setup['backColor']); ImageColorAllocate($newIm, $cols[0],$cols[1],$cols[2]);