DataObjects/Images.php
authorChris <chris@roojs.com>
Mon, 17 Jun 2013 09:05:09 +0000 (17:05 +0800)
committerChris <chris@roojs.com>
Mon, 17 Jun 2013 09:05:09 +0000 (17:05 +0800)
DataObjects/Images.php

index 582fd4e..534353d 100644 (file)
@@ -440,11 +440,11 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         //$size = max(100, (int) $size);
         //$size = min(1024, (int) $size);
         // the size should 200x150 to convert
-        $size = preg_split('/(x|c)/', $size);
-        if(empty($size[1])){
-            $size[1] = 0;
+        $sizear = preg_split('/(x|c)/', $size);
+        if(empty($sizear[1])){
+            $sizear[1] = 0;
         }
-        $size = implode('x', $size);
+        $size = implode(strpos($size,'c') > -1 ? 'c' : 'x', $sizear);
         $fc = $this->toFileConvert();
         $fc->convert($this->mimetype, $size);