Images.php
authorAlan Knowles <alan@roojs.com>
Wed, 22 Aug 2012 09:33:12 +0000 (17:33 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 22 Aug 2012 09:33:12 +0000 (17:33 +0800)
Images.php

index fc30f85..80f1e7d 100644 (file)
@@ -213,7 +213,16 @@ class Pman_Core_Images extends Pman
         }
         //echo "SKALING?  $this->size";
         // acutally if we generated the image, then we do not need to validate the size..
-        $this->validateSize();
+        
+        // if the mimetype is not converted..
+        // then the filename should be FILEPART.{size}.jpg
+        $ar = explode('.', $img->getStoreName());
+        $ext = array_pop($ar);
+        $ar[] = $this->size;
+        $ar[] = $ext;
+        if (!file_exists(implode('.', $ar))) {
+            $this->validateSize();
+        }
         
         $x->convert( $this->as_mimetype, $this->size);
         $x->serve();