From 27f5871373309314db0b002537b1acad446a2538 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 3 Mar 2009 21:21:16 +0000 Subject: [PATCH] (bug 12970) Add global to force client rendering of thumbs. Helpful for victims of safe_mode which can break thumbnailing Very Badly. --- RELEASE-NOTES | 2 ++ includes/DefaultSettings.php | 6 ++++++ includes/media/Bitmap.php | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7392098db9..594a2f9977 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -25,6 +25,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Added $wgUseTwoButtonsSearchForm to choose the Search form behavior/look * Added $wgNoFollowDomainExceptions to allow exempting particular domain names from rel="nofollow" on external links +* (bug 12970) Added $wgForceClientThumbnails to force client rendering of thumbs, + instead of falling back to GD. === New features in 1.15 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 26836b7c86..c72617e496 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2107,6 +2107,12 @@ $wgGenerateThumbnailOnParse = true; /** Obsolete, always true, kept for compatibility with extensions */ $wgUseImageResize = true; +/** + * Use this if you have issues using gd for image thumbnails--like with + * safe_mode--and want to force thumbnailing to users. Not needed for most + * installs. See bug 12970. + */ +$wgForceClientThumbnails = false; /** Set $wgCommandLineMode if it's not set already, to avoid notices */ if( !isset( $wgCommandLineMode ) ) { diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index b949ae3dca..427c780343 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -42,7 +42,7 @@ class BitmapHandler extends ImageHandler { function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) { global $wgUseImageMagick, $wgImageMagickConvertCommand, $wgImageMagickTempDir; - global $wgCustomConvertCommand; + global $wgCustomConvertCommand, $wgForceClientThumbnails; global $wgSharpenParameter, $wgSharpenReductionThreshold; global $wgMaxAnimatedGifArea; @@ -73,6 +73,8 @@ class BitmapHandler extends ImageHandler { $scaler = 'im'; } elseif ( $wgCustomConvertCommand ) { $scaler = 'custom'; + } elseif( $wgForceClientThumbnails ) { + $scaler = 'client'; } elseif ( function_exists( 'imagecreatetruecolor' ) ) { $scaler = 'gd'; } else { -- 2.20.1