DataObjects/Images.php
[Pman.Core] / DataObjects / Images.php
index e26ff0b..4c1b928 100644 (file)
@@ -830,10 +830,6 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         
         $data = file_get_contents($file);
         
-        if($rotate){
-            $data = $this->rotate();
-        }
-        
         if(!empty($scaleWidth) || !empty($scaleHeight)){
             
             $width = $this->width;
@@ -870,6 +866,10 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
             
         }
         
+        if($rotate){
+            $data = $this->rotate($data);
+        }
+        
         $base64 = 'data:' . $this->mimetype . ';base64,' . base64_encode($data);
         
         return $base64;
@@ -915,7 +915,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         }
         
         $orientation = $imagick->getImageOrientation(); 
-//        print_R($orientation);exit;
+        print_R($orientation);exit;
         switch($orientation) { 
             case Imagick::ORIENTATION_BOTTOMRIGHT: 
                 $imagick->rotateimage(new ImagickPixel('#00000000'), 180); // rotate 180 degrees