MediaWiki Render large GIFs

From WikiMLT

Here is a short man­u­al how to al­low Me­di­aWi­ki 1.35+ to ren­der large GIF files. By the de­fault con­fig­u­ra­tion I've faced a trou­ble when tried to ren­der a GIF file with 502 frames and res­o­lu­tion 960×612 pix­els.

Im­ageMag­ick: Con­fig­ure mem­o­ry al­lo­ca­tion

Find the Im­ageMag­ick' con­fig­u­ra­tion file by the fol­low­ing com­mand.

identify -list policy | grep 'Path.*xml'

The mem­o­ry lim­it can be con­fig­ured by mod­i­fy­ing the fol­low­ing line in /​​​etc/​​​ImageMagick‑6/​​​policy.xml.

<policy domain="resource" name="memory" value="256MiB"/>

If your serv­er has enough RAM set value="1GiB".

Me­di­aWi­ki: In­crease mem­o­ry lim­it

Ed­it your LocalSettings.php and set ap­pro­pri­ate val­ues for $wg­MaxShellMem­o­ry, $wg­Max­Im­ageArea and $wg­Max­An­i­mat­edG­i­fArea. In my case these are as fol­low.

<?php // remove this tag
$wgMaxShellMemory = 1228800;
$wgMaxImageArea = 10e7;
$wgMaxAnimatedGifArea = 10e7;

Ref­er­ences