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