From d15275326e4095247c50507977aa355e78a049cd Mon Sep 17 00:00:00 2001 From: Edward Date: Thu, 4 Oct 2018 11:01:38 +0800 Subject: [PATCH] DataObjects/Images.php --- DataObjects/Images.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/DataObjects/Images.php b/DataObjects/Images.php index 4edf3480..5884eabc 100644 --- a/DataObjects/Images.php +++ b/DataObjects/Images.php @@ -843,9 +843,18 @@ class Pman_Core_DataObjects_Images extends DB_DataObject if(empty($scaleHeight)){ $height = $this->height * $scaleWidth / $this->width; } + } + + if(!empty($scaleHeight)){ + $height = $scaleHeight; + if(empty($scaleWidth)){ + $width = $this->width * $scaleHeight / $this->height; + } } + + $base64 = 'data:' . $this->mimetype . ';base64,' . base64_encode($data); return $base64; -- 2.39.2