From: Chad Horohoe Date: Mon, 13 Apr 2009 15:05:47 +0000 (+0000) Subject: If the file doesn't exist, we get a whole bunch of cascading PHP errors. X-Git-Tag: 1.31.0-rc.0~42151 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=bee2293cbea254f481885e9f4061202bb696d2c4;p=lhc%2Fweb%2Fwiklou.git If the file doesn't exist, we get a whole bunch of cascading PHP errors. --- 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 );