From: Brion Vibber Date: Fri, 26 May 2006 21:33:38 +0000 (+0000) Subject: * Add $wgIgnoreImageErrors to suppress error messages for thumbnail rendering problem... X-Git-Tag: 1.31.0-rc.0~57016 X-Git-Url: http://git.cyclocoop.org/data/%7BGarradin/WEBSITE%7D?a=commitdiff_plain;h=fcc206e28887295682e5c05a5a3307bfef53aa7e;p=lhc%2Fweb%2Fwiklou.git * Add $wgIgnoreImageErrors to suppress error messages for thumbnail rendering problems. If errors are transitory, this should reduce annoying messages making it into cached display. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 45cfc31417..d83d45ee65 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -348,6 +348,10 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Shut up the parser test whining about files in a temp directory. * (bug 6098) Add Aragonese language support (an) * (bug 6101) Update for Russian language (ru) +* Add $wgIgnoreImageErrors to suppress error messages for thumbnail rendering + problems. If errors are transitory, this should reduce annoying messages + making it into cached display. + == Compatibility == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index a96a1d0671..4a8cda7c45 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1326,6 +1326,18 @@ $wgMaxImageArea = 1.25e7; */ $wgThumbnailEpoch = '20030516000000'; +/** + * If set, inline scaled images will still produce tags ready for + * output instead of showing an error message. + * + * This may be useful if errors are transitory, especially if the site + * is configured to automatically render thumbnails on request. + * + * On the other hand, it may obscure error conditions from debugging. + * Enable the debug log or the 'thumbnail' log group to make sure errors + * are logged to a file for review. + */ +$wgIgnoreImageErrors = false; /** Set $wgCommandLineMode if it's not set already, to avoid notices */ diff --git a/includes/Image.php b/includes/Image.php index 1ba084eb8f..cf92d97bc7 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -1011,6 +1011,10 @@ class Image $this->lastError = $this->reallyRenderThumb( $thumbPath, $width, $height ); if ( $this->lastError === true ) { $done = true; + } elseif( $GLOBALS['wgIgnoreImageErrors'] ) { + // Log the error but output anyway. + // With luck it's a transitory error... + $done = true; } # Purge squid