ImageMagick 5.5.8 was the beta, 6.0.0 the actual release
[lhc/web/wiklou.git] / thumb.php
index 4ec40dc..a056dcc 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -54,12 +54,17 @@ require_once( 'Setup.php' );
 wfProfileIn( 'thumb.php-render' );
 
 $img = Image::newFromName( $fileName );
-if ( $img ) {
-       if ( ! is_null( $page ) ) {
-               $img->selectPage( $page );
+try {
+       if ( $img ) {
+               if ( ! is_null( $page ) ) {
+                       $img->selectPage( $page );
+               }
+               $thumb = $img->renderThumb( $width, false );
+       } else {
+               $thumb = false;
        }
-       $thumb = $img->renderThumb( $width, false );
-} else {
+} catch( Exception $ex ) {
+       // Tried to select a page on a non-paged file?
        $thumb = false;
 }