ENHANCEMENT Image -> SetWidth() and Image -> SetHeight() generate new image when size is the same as the original file (fixes #5792)

This commit is contained in:
j.m.milmine 2011-03-18 22:58:17 +00:00 committed by Ingo Schommer
parent 1c12a226a3
commit 627a2916f4

View File

@ -159,15 +159,15 @@ class Image extends File {
}
public function SetWidth($width) {
return $this->getFormattedImage('SetWidth', $width);
return $this->getWidth() == $width ? $this : $this->getFormattedImage('SetWidth', $width);
}
public function SetHeight($height) {
return $this->getFormattedImage('SetHeight', $height);
return $this->getHeight() == $height ? $this : $this->getFormattedImage('SetHeight', $height);
}
public function SetSize($width, $height) {
return $this->getFormattedImage('SetSize', $width, $height);
return (($this->getWidth() == $width) && ($this->getHeight() == $height)) ? $this : $this->getFormattedImage('SetSize', $width, $height);
}
public function SetRatioSize($width, $height) {