r43080 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43079‎ | r43080 | r43081 >
Date:16:45, 2 November 2008
Author:tstarling
Status:old
Tags:
Comment:
* Set a special temporary directory for ImageMagick with $wgImageMagickTempDir
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/media/Bitmap.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/media/Bitmap.php
@@ -41,7 +41,7 @@
4242 }
4343
4444 function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
45 - global $wgUseImageMagick, $wgImageMagickConvertCommand;
 45+ global $wgUseImageMagick, $wgImageMagickConvertCommand, $wgImageMagickTempDir;
4646 global $wgCustomConvertCommand;
4747 global $wgSharpenParameter, $wgSharpenReductionThreshold;
4848 global $wgMaxAnimatedGifArea;
@@ -122,6 +122,12 @@
123123 }
124124 }
125125
 126+ if ( strval( $wgImageMagickTempDir ) !== '' ) {
 127+ $tempEnv = 'MAGICK_TMPDIR=' . wfEscapeShellArg( $wgImageMagickTempDir ) . ' ';
 128+ } else {
 129+ $tempEnv = '';
 130+ }
 131+
126132 # Specify white background color, will be used for transparent images
127133 # in Internet Explorer/Windows instead of default black.
128134
@@ -129,7 +135,9 @@
130136 # It seems that ImageMagick has a bug wherein it produces thumbnails of
131137 # the wrong size in the second case.
132138
133 - $cmd = wfEscapeShellArg($wgImageMagickConvertCommand) .
 139+ $cmd =
 140+ $tempEnv .
 141+ wfEscapeShellArg($wgImageMagickConvertCommand) .
134142 " {$quality} -background white -size {$physicalWidth} ".
135143 wfEscapeShellArg($srcPath . $frame) .
136144 $animation .
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1969,6 +1969,12 @@
19701970 /** Reduction in linear dimensions below which sharpening will be enabled */
19711971 $wgSharpenReductionThreshold = 0.85;
19721972
 1973+/**
 1974+ * Temporary directory used for ImageMagick. The directory must exist. Leave
 1975+ * this set to false to let ImageMagick decide for itself.
 1976+ */
 1977+$wgImageMagickTempDir = false;
 1978+
19731979 /**
19741980 * Use another resizing converter, e.g. GraphicMagick
19751981 * %s will be replaced with the source path, %d with the destination
Index: trunk/phase3/RELEASE-NOTES
@@ -187,6 +187,8 @@
188188 directly blocked
189189 * (bug 13710) Allow to force "watch this" checkbox via URL using para "watchthis"
190190 * (bug 15125) Add Public Domain to default options when installing. Patch by Nathan Larson.
 191+* Set a special temporary directory for ImageMagick with $wgImageMagickTempDir
 192+
191193 === Bug fixes in 1.14 ===
192194
193195 * (bug 14907) DatabasePostgres::fieldType now defined.

Status & tagging log