Index: trunk/phase3/includes/media/Bitmap.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | } |
43 | 43 | |
44 | 44 | function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) { |
45 | | - global $wgUseImageMagick, $wgImageMagickConvertCommand; |
| 45 | + global $wgUseImageMagick, $wgImageMagickConvertCommand, $wgImageMagickTempDir; |
46 | 46 | global $wgCustomConvertCommand; |
47 | 47 | global $wgSharpenParameter, $wgSharpenReductionThreshold; |
48 | 48 | global $wgMaxAnimatedGifArea; |
— | — | @@ -122,6 +122,12 @@ |
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
| 126 | + if ( strval( $wgImageMagickTempDir ) !== '' ) { |
| 127 | + $tempEnv = 'MAGICK_TMPDIR=' . wfEscapeShellArg( $wgImageMagickTempDir ) . ' '; |
| 128 | + } else { |
| 129 | + $tempEnv = ''; |
| 130 | + } |
| 131 | + |
126 | 132 | # Specify white background color, will be used for transparent images |
127 | 133 | # in Internet Explorer/Windows instead of default black. |
128 | 134 | |
— | — | @@ -129,7 +135,9 @@ |
130 | 136 | # It seems that ImageMagick has a bug wherein it produces thumbnails of |
131 | 137 | # the wrong size in the second case. |
132 | 138 | |
133 | | - $cmd = wfEscapeShellArg($wgImageMagickConvertCommand) . |
| 139 | + $cmd = |
| 140 | + $tempEnv . |
| 141 | + wfEscapeShellArg($wgImageMagickConvertCommand) . |
134 | 142 | " {$quality} -background white -size {$physicalWidth} ". |
135 | 143 | wfEscapeShellArg($srcPath . $frame) . |
136 | 144 | $animation . |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1969,6 +1969,12 @@ |
1970 | 1970 | /** Reduction in linear dimensions below which sharpening will be enabled */ |
1971 | 1971 | $wgSharpenReductionThreshold = 0.85; |
1972 | 1972 | |
| 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 | + |
1973 | 1979 | /** |
1974 | 1980 | * Use another resizing converter, e.g. GraphicMagick |
1975 | 1981 | * %s will be replaced with the source path, %d with the destination |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -187,6 +187,8 @@ |
188 | 188 | directly blocked |
189 | 189 | * (bug 13710) Allow to force "watch this" checkbox via URL using para "watchthis" |
190 | 190 | * (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 | + |
191 | 193 | === Bug fixes in 1.14 === |
192 | 194 | |
193 | 195 | * (bug 14907) DatabasePostgres::fieldType now defined. |