+ } elseif( $mimeType == 'image/gif' ) {
+ if( $srcWidth * $srcHeight > $wgMaxAnimatedGifArea ) {
+ // Extract initial frame only; we're so big it'll
+ // be a total drag. :P
+ $frame = '[0]';
+ } else {
+ // Coalesce is needed to scale animated GIFs properly (bug 1017).
+ $animation = ' -coalesce ';
+ }
+ }
+
+ if ( strval( $wgImageMagickTempDir ) !== '' ) {
+ $tempEnv = 'MAGICK_TMPDIR=' . wfEscapeShellArg( $wgImageMagickTempDir ) . ' ';