[Typo3-dev] function imagecopyresized

Thomas Peterson info at thomas-peterson.de
Tue Mar 30 11:29:03 CEST 2004


Hello

In this Function make:

________________________
function imagecopyresized(&$im, $cpImg, $Xstart, $Ystart, $cpImgCutX,
$cpImgCutY, $w, $h, $w, $h) {
  if ($this->GD2) {
   $im_base = imagecreatetruecolor(imagesx($im), imagesy($im)); // Make true
color image
   imagecopyresized($im_base, $im, 0,0,0,0,
imagesx($im),imagesy($im),imagesx($im),imagesy($im)); // Copy the source
image onto that
   imagecopyresized($im_base, $cpImg, $Xstart, $Ystart, $cpImgCutX,
$cpImgCutY, $w, $h, $w, $h); // Then copy the $cpImg onto that (the actual
operation!)
   $im = $im_base; // Set pointer
_______________________

This make:

_______________________
         $this->makeEffect($im, Array('value'=>'colors=256')); // Reduce
colors to 256 - make SURE that IM is working then!
_______________________

the Image bad.

_______________________
  } else {
   imagecopyresized($im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY,
$w, $h, $w, $h);
  }
_______________________


Found with Zend Debugger.

Thanks

My English is bad.






More information about the TYPO3-dev mailing list