From 627a2916f48af24d399ad6e06fe97cde117fc776 Mon Sep 17 00:00:00 2001 From: "j.m.milmine" Date: Fri, 18 Mar 2011 22:58:17 +0000 Subject: [PATCH] ENHANCEMENT Image -> SetWidth() and Image -> SetHeight() generate new image when size is the same as the original file (fixes #5792) --- model/Image.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model/Image.php b/model/Image.php index 5d43bc538..6df8a5203 100644 --- a/model/Image.php +++ b/model/Image.php @@ -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) {