mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX GD::setQuality() persistence issue because the GD instance is re-created instead of being cloned - thanks Tjofras! (from r100438)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105569 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f7c34fc73c
commit
d74e3c43fe
@ -90,7 +90,7 @@ class GD extends Object {
|
|||||||
|
|
||||||
imagecopyresampled($newGD, $this->gd, 0,0, $srcX, $srcY, $width, $height, $srcWidth, $srcHeight);
|
imagecopyresampled($newGD, $this->gd, 0,0, $srcX, $srcY, $width, $height, $srcWidth, $srcHeight);
|
||||||
}
|
}
|
||||||
$output = new GD();
|
$output = clone $this;
|
||||||
$output->setGD($newGD);
|
$output->setGD($newGD);
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ class GD extends Object {
|
|||||||
|
|
||||||
imagecopyresampled($newGD, $this->gd, 0,0, 0, 0, $width, $height, $this->width, $this->height);
|
imagecopyresampled($newGD, $this->gd, 0,0, 0, 0, $width, $height, $this->width, $this->height);
|
||||||
|
|
||||||
$output = new GD();
|
$output = clone $this;
|
||||||
$output->setGD($newGD);
|
$output->setGD($newGD);
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
@ -148,13 +148,13 @@ class GD extends Object {
|
|||||||
function rotate($angle) {
|
function rotate($angle) {
|
||||||
if(!$this->gd) return;
|
if(!$this->gd) return;
|
||||||
|
|
||||||
if(function_exists("imagerotate")) {
|
if(function_exists("imagerotate")) {
|
||||||
$newGD = imagerotate($this->gd, $angle,0);
|
$newGD = imagerotate($this->gd, $angle,0);
|
||||||
} else {
|
} else {
|
||||||
//imagerotate is not included in PHP included in Ubuntu
|
//imagerotate is not included in PHP included in Ubuntu
|
||||||
$newGD = $this->rotatePixelByPixel($angle);
|
$newGD = $this->rotatePixelByPixel($angle);
|
||||||
}
|
}
|
||||||
$output = new GD();
|
$output = clone $this;
|
||||||
$output->setGD($newGD);
|
$output->setGD($newGD);
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ class GD extends Object {
|
|||||||
$newGD = imagecreatetruecolor($width, $height);
|
$newGD = imagecreatetruecolor($width, $height);
|
||||||
imagecopyresampled($newGD, $this->gd, 0, 0, $left, $top, $width, $height, $width, $height);
|
imagecopyresampled($newGD, $this->gd, 0, 0, $left, $top, $width, $height, $width, $height);
|
||||||
|
|
||||||
$output = new GD();
|
$output = clone $this;
|
||||||
$output->setGD($newGD);
|
$output->setGD($newGD);
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
@ -329,7 +329,7 @@ class GD extends Object {
|
|||||||
|
|
||||||
imagecopyresampled($newGD, $this->gd, $destX, $destY, 0, 0, $destWidth, $destHeight, $this->width, $this->height);
|
imagecopyresampled($newGD, $this->gd, $destX, $destY, 0, 0, $destWidth, $destHeight, $this->width, $this->height);
|
||||||
}
|
}
|
||||||
$output = new GD();
|
$output = clone $this;
|
||||||
$output->setGD($newGD);
|
$output->setGD($newGD);
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
@ -360,11 +360,8 @@ class GD extends Object {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// imagecopyresampled($newGD, $this->gd, 0,0, $srcX, $srcY, $width, $height, $srcWidth, $srcHeight);
|
$output = clone $this;
|
||||||
|
|
||||||
$output = new GD();
|
|
||||||
$output->setGD($newGD);
|
$output->setGD($newGD);
|
||||||
if($this->quality) $output->setQuality($this->quality);
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user