DataObjects/Images.php
authorEdward <edward@roojs.com>
Thu, 4 Oct 2018 03:02:13 +0000 (11:02 +0800)
committerEdward <edward@roojs.com>
Thu, 4 Oct 2018 03:02:13 +0000 (11:02 +0800)
DataObjects/Images.php

index 5884eab..1c0d86a 100644 (file)
@@ -833,24 +833,30 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         if($rotate){
             $data = $this->rotate();
         }
         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;
+                }
             }
             }
+            
+            
+            
         }
         
         
         }