Author: Tobias Schlitt
Date: 2006-01-26 10:44:37 +0100 (Thu, 26 Jan 2006)
New Revision: 2038

Log:
- Fix unreported bug: ezcImageTransformation will cause an error, if no filters 
are submitted, but only a MIME type conversion is set.

Modified:
   packages/ImageConversion/trunk/src/transformation.php

Modified: packages/ImageConversion/trunk/src/transformation.php
===================================================================
--- packages/ImageConversion/trunk/src/transformation.php       2006-01-26 
09:22:31 UTC (rev 2037)
+++ packages/ImageConversion/trunk/src/transformation.php       2006-01-26 
09:44:37 UTC (rev 2038)
@@ -240,6 +240,13 @@
                 $this->lastHandler->applyFilter( $ref, $filter );
             }
 
+            // When no filters are performed by a transformation, we might 
have no last handler here
+            if ( !isset( $this->lastHandler ) )
+            {
+                $this->lastHandler = $this->converter->getHandler( null, 
$mimeIn, $outMime );
+                $ref = $this->lastHandler->load( $fileTmp, $mimeIn );
+            }
+
             // Perform conversion
             if ( $this->lastHandler->allowsOutput( ( $outMime ) ) )
             {
@@ -251,11 +258,11 @@
                 $this->lastHandler->save( $ref );
                 $this->lastHandler->close( $ref );
                 // Retreive correct handler
-                $this->lastHandler = $this->converter->getHandler( null, 
$mimeIn, $mimeOut );
+                $this->lastHandler = $this->converter->getHandler( null, 
$mimeIn, $outMime );
                 // Load in new handler
                 $res = $this->lastHandler->load( $fileTmp );
                 // Perform conversion
-                $this->lastHandler->convert( $ref, $mimeOut );
+                $this->lastHandler->convert( $ref, $outMime );
             }
             // Everything done, save and close
             $this->lastHandler->save( $ref );

-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to