Author: david
Date: Tue Jul 26 13:58:35 2011
New Revision: 9382

Log:
Can't assume that reference rep should be an image

Modified:
   trunk/lib/model/QubitDigitalObject.php

Modified: trunk/lib/model/QubitDigitalObject.php
==============================================================================
--- trunk/lib/model/QubitDigitalObject.php      Tue Jul 26 12:23:42 2011        
(r9381)
+++ trunk/lib/model/QubitDigitalObject.php      Tue Jul 26 13:58:35 2011        
(r9382)
@@ -413,12 +413,10 @@
       throw new sfException('Not a valid filename');
     }
 
-    // Fail if asset's intended usage is a reference or thumbnail object and
-    // it's *not* an image mimetype
-    $allowed = QubitDigitalObject::isImageFile($asset->getName()) || 
QubitDigitalObject::isAudioFile($asset->getName());
-    if (in_array($this->usageId, array(QubitTerm::REFERENCE_ID, 
QubitTerm::THUMBNAIL_ID)) && false == $allowed)
+    // Fail if "thumbnail" is not an image
+    if (!QubitDigitalObject::isImageFile($asset->getName()) && 
QubitTerm::THUMBNAIL_ID == $this->usageId)
     {
-      throw new sfException('Reference or thumbnail asset is not compatible 
with current mime-type');
+      throw new sfException('Thumbnail must be valid image type (jpeg, png, 
gif)');
     }
 
     // Get clean file name (no bad chars)

-- 
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.com/group/qubit-commits?hl=en.

Reply via email to