Correction du bug de rotation !

This commit is contained in:
Shikiryu 2010-11-29 15:38:44 +00:00
parent ae129cf977
commit dd7e4a4ba4
1 changed files with 6 additions and 5 deletions

View File

@ -267,9 +267,9 @@ class SVGTOIMAGE{
//rotating the image if needed
if($r != 0){
if($this->_debug){
if($newImage = imagerotate($newImage, - floatval($r), -1))
if($newImage = imagerotate($newImage, - floatval($r), -1)){
$this->_log->message('Rotating image');
else
}else
$this->_log->error('Rotating image');
}else{
$newImage = imagerotate($newImage, - floatval($r), -1);
@ -277,9 +277,10 @@ class SVGTOIMAGE{
$blue = imagecolorallocate($newImage, $this->transparentColor[0], $this->transparentColor[1],$this->transparentColor[2]);
imagecolortransparent($newImage, $blue);
}
imagecopy($this->_image,$newImage,$x,$y,0,0, $width , $height);
//imagecopy($this->_image,$newImage,$x,$y,0,0,imagesx($newImage) , imagesy($newImage));
$newWidth = imagesx($newImage);
$newHeight = imagesy($newImage);
//imagecopy($this->_image,$newImage,$x,$y,0,0, $width , $height);
imagecopy($this->_image,$newImage,($newWidth == $width) ? $x : $x-($newWidth-$width)/2,($newHeight == $height) ? $y : $y-($newHeight-$height)/2,0,0,imagesx($newImage) , imagesy($newImage));
}
/*