DataObjects/Core_watch.php
[Pman.Core] / Images.php
index 9f391c3..65266fc 100644 (file)
@@ -59,7 +59,7 @@ class Pman_Core_Images extends Pman
         
         $bits= explode('/', $s);
         $id = 0;
-        
+//        var_dump($bits);die('in');
         // without id as first part...
         if (!empty($bits[0]) && $bits[0] == 'Thumb') {
             $this->thumb = true;
@@ -172,10 +172,12 @@ class Pman_Core_Images extends Pman
         
        
         $img = DB_DataObjecT::factory('Images');
+         
         if (!$id || !$img->get($id)) {
              
             header('Location: ' . $this->rootURL . '/Pman/templates/images/file-broken.png?reason=' .
                 urlencode("image has been removed or deleted."));
+            
         }
         $this->serve($img);
         exit;
@@ -201,7 +203,6 @@ class Pman_Core_Images extends Pman
         }
         
         
-        
         $this->as_mimetype = $_REQUEST['as'];
         $this->mimetype = $_REQUEST['mimetype'];
         require_once 'File/MimeType.php';
@@ -212,11 +213,9 @@ class Pman_Core_Images extends Pman
         $tmp = $this->tempName($src_ext);
         file_put_contents($tmp, $_REQUEST['data']);
         
-        
-        
         require_once 'File/Convert.php';
         $cv = new File_Convert($tmp, $this->mimetype);
-        print_r($cv);exit;
+        
         $fn = $cv->convert(
                 $this->as_mimetype ,
                 empty($_REQUEST['width']) ? 0 : $_REQUEST['width'],
@@ -241,12 +240,12 @@ class Pman_Core_Images extends Pman
         
         require_once 'File/Convert.php';
         if (!file_exists($img->getStoreName())) {
-            //print_r($img);exit;
+//            print_r($img);exit;
             header('Location: ' . $this->rootURL . '/Pman/templates/images/file-broken.png?reason=' .
                 urlencode("Original file was missing : " . $img->getStoreName()));
     
         }
-        
+//        print_r($img);exit;
         $x = $img->toFileConvert();
         if (empty($this->as_mimetype)) {
             $this->as_mimetype  = $img->mimetype;