Merge "mw.language.convertPlural: Check if matching form exists"
[lhc/web/wiklou.git] / includes / media / Bitmap.php
index e2444a1..4959687 100644 (file)
@@ -168,6 +168,13 @@ class BitmapHandler extends ImageHandler {
 
                # Transform functions and binaries need a FS source file
                $scalerParams['srcPath'] = $image->getLocalRefPath();
+               if ( $scalerParams['srcPath'] === false ) { // Failed to get local copy
+                       wfDebugLog( 'thumbnail',
+                               sprintf( 'Thumbnail failed on %s: could not get local copy of "%s"',
+                                       wfHostname(), $image->getName() ) );
+                       return new MediaTransformError( 'thumbnail_error',
+                               $scalerParams['clientWidth'], $scalerParams['clientHeight'] );
+               }
 
                # Try a hook
                $mto = null;
@@ -701,7 +708,6 @@ class BitmapHandler extends ImageHandler {
                imagejpeg( $dst_image, $thumbPath, 95 );
        }
 
-
        /**
         * Returns whether the current scaler supports rotation (im and gd do)
         *