Author: sevein
Date: Thu Sep 17 07:59:50 2009
New Revision: 3360

Log:
Return false when sfThumbnail adapters couldn't resize the given resource due 
to different causes.

Modified:
   trunk/lib/model/QubitDigitalObject.php

Modified: trunk/lib/model/QubitDigitalObject.php
==============================================================================
--- trunk/lib/model/QubitDigitalObject.php      Thu Sep 17 00:02:40 2009        
(r3359)
+++ trunk/lib/model/QubitDigitalObject.php      Thu Sep 17 07:59:50 2009        
(r3360)
@@ -1264,8 +1264,15 @@
     }
 
     // Create a thumbnail
-    $newImage = new sfThumbnail($width, $height, true, false, 75, $adapter, 
array('extract' => 1));
-    $newImage->loadFile($originalImageName);
+    try
+    {
+      $newImage = new sfThumbnail($width, $height, true, false, 75, $adapter, 
array('extract' => 1));
+      $newImage->loadFile($originalImageName);
+    }
+    catch (Exception $e)
+    {
+      return false;
+    }
 
     return $newImage->toString();
   }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to