From bee2293cbea254f481885e9f4061202bb696d2c4 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 13 Apr 2009 15:05:47 +0000 Subject: [PATCH] If the file doesn't exist, we get a whole bunch of cascading PHP errors. --- includes/media/Bitmap.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index c2f2458e75..76cc89133b 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -191,6 +191,12 @@ class BitmapHandler extends ImageHandler { return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err ); } + if ( !file_exists( $srcPath ) ) { + $err = "File seems to be missing: $srcPath"; + wfDebug( "$err\n" ); + return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err ); + } + $src_image = call_user_func( $loader, $srcPath ); $dst_image = imagecreatetruecolor( $physicalWidth, $physicalHeight ); -- 2.20.1