DataObjects/Core_notify.php
[Pman.Core] / DataObjects / Images.php
index 8a1fcaf..b9fae2a 100644 (file)
@@ -298,6 +298,9 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         if (in_array($this->mimetype, array(
                         'text/application',
                         'application/octet-stream',
+                        'image/x-png',  // WTF does this?
+                        'image/pjpeg',  // WTF does this?
+                        'application/x-apple-msg-attachment', /// apple doing it's magic...
                         'application/vnd.ms-excel',   /// sometimes windows reports csv as excel???
                         'application/csv-tab-delimited-table', // windows again!!?
                 ))) { // weird tyeps..
@@ -428,7 +431,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
             $baseURL = '';
         }
        
-        if (empty($size)) {
+        if ($size < 0) {
             $provider = preg_replace('#/Thumb$#', '', $provider);
             
             return $baseURL . $provider . "/{$this->id}/{$this->filename}";
@@ -437,7 +440,15 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         //$size = max(100, (int) $size);
         //$size = min(1024, (int) $size);
         // the size should 200x150 to convert
+        $sizear = preg_split('/(x|c)/', $size);
+        if(empty($sizear[1])){
+            $sizear[1] = 0;
+        }
+        $size = implode(strpos($size,'c') > -1 ? 'c' : 'x', $sizear);
+//        print_r($size);
         $fc = $this->toFileConvert();
+//        print_r($size);
+//        exit;
         $fc->convert($this->mimetype, $size);