From bde9b91a43255cc5a19063ba5efb1b5375ced5a4 Mon Sep 17 00:00:00 2001 From: Edward Date: Thu, 4 Oct 2018 11:02:13 +0800 Subject: [PATCH] DataObjects/Images.php --- DataObjects/Images.php | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/DataObjects/Images.php b/DataObjects/Images.php index 5884eabc..1c0d86a9 100644 --- a/DataObjects/Images.php +++ b/DataObjects/Images.php @@ -833,24 +833,30 @@ class Pman_Core_DataObjects_Images extends DB_DataObject if($rotate){ $data = $this->rotate(); } + + if(!empty($scaleWidth) || !empty($scaleHeight)){ - $width = $this->width; - $height = $this->height; + $width = $this->width; + $height = $this->height; - if(!empty($scaleWidth)){ - $width = $scaleWidth; + if(!empty($scaleWidth)){ + $width = $scaleWidth; - if(empty($scaleHeight)){ - $height = $this->height * $scaleWidth / $this->width; + if(empty($scaleHeight)){ + $height = $this->height * $scaleWidth / $this->width; + } } - } - - if(!empty($scaleHeight)){ - $height = $scaleHeight; - if(empty($scaleWidth)){ - $width = $this->width * $scaleHeight / $this->height; + if(!empty($scaleHeight)){ + $height = $scaleHeight; + + if(empty($scaleWidth)){ + $width = $this->width * $scaleHeight / $this->height; + } } + + + } -- 2.39.2