Manual talk:$wgMaxShellMemory

Error creating thumbnail: Invalid thumbnail parameters
This particular code was discussed in detail here: http://www.gossamer-threads.com/lists/wiki/mediawiki/169439 as fixing imagemagick problems. Adamtheclown 22:24, 17 January 2011 (UTC)
 * This line can be added to the end of LocalSettings.php. Adamtheclown 00:31, 21 February 2011 (UTC)

Please change default to something that WORKS
The default value of $wgMaxShellMemory in MW1.19.2 is too low for SVG thumbnail rendering. Please change the default value to one that consistently works on most servers, say 300000K.

The Error message produced by a value too low is far too obtuse: Error creating thumbnail: ERROR: meta.c (179): wmf_header_read: this isn't a wmf file convert: Delegate failed `"wmf2svg" -o "%o" "%i"'. convert: unable to open image `/tmp/magick-XXn4EQJ3': No such file or directory. convert: unable to load module `/usr/lib64/ImageMagick-6.2.8/modules-Q16/coders/svg.la': libdbus-1.so.3: failed to map segment from shared object: Cannot allocate memory. convert: unable to open file `/tmp/magick-XXn4EQJ3': No such file or directory. convert: missing an image filename `PNG:/tmp/transform_402f06e-1.png'.

Setting $wgMaxShellMemory to 300000 FIXED IT. (Thanks folks on Mediawiki-l for the tip! I would never have thought of this!)

A comment in MW-generated LocalSettings.php suggesting "Set $wgMaxShellMemory = 300000; when you allow SVG uploads" might help. --Rogerhc (talk) 19:29, 31 October 2012 (UTC)

Caution: This is LINUX only! Won't work with POSIX like systems e.g. FreeBSD
Hi everyone,

the function wfShellExec checks OS for "Linux" before using "ulimit4.sh", so for example FreeBSD won't use any ulimit here. This will fail sooner or later.

Someone[tm] should[tm] create a patch for ulimit4.sh and wfShellExec to enable ulimits for any POSIX aware operating system having a /bin/sh. Bug report will follow. --Rabe (talk) 10:06, 26 April 2013 (UTC)


 * I patched this for my system and verified it by getting a memory allocation error now:

Fehler beim Erstellen des Vorschaubildes: convert: memory allocation failed `/data/www/wiki.*****.org/secure/images/1/1b/FreeBSD_System_verschluesseln_mit_geli(8)_Diagramm.svg' @ error/svg.c/ReadSVGImage/2968. convert: no images defined `PNG:/data/www/wiki.*****.org/secure/images/temp/transform_28149c237e88-1.png' @ error/convert.c/ConvertImageCommand/3078.
 * The Community should check my patches (especially on Linux), see Bug 47781.
 * Regards --Rabe (talk) 22:24, 26 April 2013 (UTC)
 * BugReport, please review and comment! --Rabe (talk) 19:37, 27 April 2013 (UTC)