Manual talk:Image administration

See Error creating thumbnail for possible solutions for this error

Image Upload/Access location mismatch
I installed from an ubuntu package, MediaWiki 1.11.2 How can I configure it for everything to come from /var/www/mediawiki?
 * In LocalSetting.php, I have set MW_INSTALL_PATH to /var/www/mediawiki
 * When I upload an image it goes into /var/www/mediawiki/images
 * But when I try to display that image, I get nothing. In the apache error log I see that it is trying to access the image file from /var/lib/mediawiki/images.

Thanks

Update
-- I 'fixed' this by creating a symlink

How to use Mediawiki:Licenses?
I think the text in this article is hard to understand. I don't want my users to be able to upload images without selecting a license. How do I do that? There's a default option called "No license selected", I want that greyed out or something. Add: it would be nice to explain what to do or where to look if one (a 'sysop') wants to enable this. Currently, there's no clue where to go.

Cannot get convert (thumbnail) to work on W2k3

 * Installed Dynamic ImageMagick in the following directory -> D:\ImageMagick-6.3.0-Q16
 * Verified that ImageMagick worked on command line
 * Verified Environment variable is PATH'd correctly
 * Verified to Web Server has access to D:\ImageMagick-6.3.0-Q16 directory
 * Modified LocalSettings.php with the following lines:
 * $wgUseImageResize		= true;
 * $wgUseImageMagick		= true;
 * $wgImageMagickConvertCommand	= "D:\\ImageMagick-6.3.0-Q16\\convert.exe";

also tried:
 * $wgImageMagickConvertCommand	= "D:\\ImageMagick-6.3.0-Q16\\convert";
 * $wgImageMagickConvertCommand	= "D:\\ImageMagick-6.3.0-Q16/convert.exe";
 * $wgImageMagickConvertCommand	= "D:\\ImageMagick-6.3.0-Q16/convert";
 * $wgImageMagickConvertCommand	= "/usr/bin/convert";

with no luck on any of them.

Any tips to try would be very much «appreciated».
 * Try fixing the double slashes. That ought to do it. 69.153.141.224 02:59, 22 December 2006 (UTC)

Following will be ok
$wgEnableUploads      = true; $wgUseImageResize     = true; $wgUseImageMagick = true; $wgImageMagickConvertCommand = "C:/Program Files/ImageMagick-6.3.2-Q16/convert";
 * 1) To enable image uploads, make sure the 'images' directory
 * 2) is writable, then set this to true:
 * 1) $wgImageMagickConvertCommand = "/usr/bin/convert";

-- WonYong ( Talk / Contrib ) 06:42, 3 March 2007 (UTC)

Unfortunately I have the same issue, I have my settings exactly as in this article (correct path ) however still get the error listed. Anyone else with any input?

Try just commenting the line $wgImageMagickConvertCommand, it went fine on my case.


 * If it's Windows, that last line should be:

$wgImageMagickConvertCommand = "C:/Program Files/ImageMagick-6.3.2-Q16/convert.exe"; Michael Daly 05:31, 17 July 2007 (UTC)

Solution
--LouisCyphre 12:19, 12 March 2010 (UTC) I had troubles to get ImageMagick running under WindowsXP. Mediawiki 1.15.1 Xampp 1.7.3. Following did the trick:

GlobalFunctions.php Line 2209 #$cmd = '"' . $cmd . '"';

The additional quotes caused the problem.

Bevor: wfShellExec: ""C:\Programme\ImageMagick\convert.exe" -background white -size 102 "D:\xampp\htdocs\mediawiki/images/6/64/Tt.bmp" -thumbnail "102x120!" -depth 8  "D:\xampp\htdocs\mediawiki/images/thumb/6/64/Tt.bmp/102px-Tt.bmp.png" 2>&1" thumbnail failed on xxx: error 1 "" from ""C:\Programme\ImageMagick\convert.exe" -background white -size 102 "D:\xampp\htdocs\mediawiki/images/6/64/Tt.bmp" -thumbnail "102x120!" -depth 8  "D:\xampp\htdocs\mediawiki/images/thumb/6/64/Tt.bmp/102px-Tt.bmp.png" 2>&1"

After: BitmapHandler::doTransform: running ImageMagick: "C:\Programme\ImageMagick\convert.exe" -background white -size 102 "D:\xampp\htdocs\mediawiki/images/6/64/Tt.bmp" -thumbnail "102x120!" -depth 8 "D:\xampp\htdocs\mediawiki/images/thumb/6/64/Tt.bmp/102px-Tt.bmp.png" 2>&1 wfShellExec: "C:\Programme\ImageMagick\convert.exe" -background white -size 102 "D:\xampp\htdocs\mediawiki/images/6/64/Tt.bmp" -thumbnail "102x120!" -depth 8 "D:\xampp\htdocs\mediawiki/images/thumb/6/64/Tt.bmp/102px-Tt.bmp.png" 2>&1 Request ended normally

Error creating thumbnail: Unable to run external programs in safe mode.
I couldn't manage to install and run ImageMagick properly for my own wiki. I have the error msg as it's seen in the thread when i try to use thumbnailing code of wiki. Any detailed instruction or any web page i can find instruction would be highly appreciated. I also find an old version of ImageMagick which is pre-compiled. Is that usefull and easier to install?
 * Well, you can take off safe mode. If not then there is no point in installing ImageMagick. You will get the same error message. You could use GD::SVG, that is, if you can install it. If you are on host, that might not be an option because server needs to compile it. You can get a binary but your back to the safe mode restrictions. You could call GD directly, but the thumbs will not display correctly because GD does not support svg. In other words, if you cannot disable safe mode and you are on a picky sticky host then as current your options is most likely none. I would not be too concerned. Have a look wikipedia. They have a very large amount of png images with a template asking to move to svg because they might consider the time is right. You may consider a similar option. 03:18, 19 September 2007
 * I experience the same problem. As I removed "$wgUseImageMagick = true;", the thumbnailing works well now. But SVG could not work yet. [I installed my wiki on a mandatory host, which I have no full control on it.] -- Senvey 04:30, 27 August 2008 (UTC)
 * I just got the roo-cause was the PHP is in safe mode, which was probably set in php.ini. -- Senvey 06:18, 27 August 2008 (UTC)
 * VERY strange that it works with "$wgUseImageMagick = true;" commented out, but the same here! Now thumbnailing works (all except svg), even with Safe Mode on (just use the correct safe mode exec dir etc settings)
 * I think when you disable wgUseImageMagick, MediaWiki use your previously created thumbnails so no error occured. Did you try to upload some new images and test its thumbnail? And remember that PHP config directives are not only in php.ini. If you installed PHP as Apache module, Apache's config file can effect PHP (see http://php.net/configuration.changes). To ensure that safe mode is off, you should create a .php file in the same directory with MediaWiki's index.php, fill it with the code, and view it by browser. Cumeo89 02:38, 25 March 2009 (UTC)
 * No, commenting out #$wgUseImageMagick = true; actually restores thumbnailing to newly uploaded images. SpiralOfYarn 23:56, 14 June 2009 (UTC)
 * I have exactly the same problem. Rendering thumbnails always fails with the »Unable to run external programs in safe mode« error.  In fact, at my own site safe_mode is off, as some short phpinfo instantly proves!  But what can I do?  Disabling ImageMagick is not an option as GD seems to have problems with file names containing umlauts.  I would really appreciate any hints! --77.179.108.82 21:57, 26 June 2009 (UTC)
 * Yes, and look at this google search. Lots of people have this problem.  Can't someone give an answer? Pardoned Turkey 01:53, 28 June 2009 (UTC)
 * For me this error was caused by disable_functions including passthru. Removing passthru from the list of disabled functions made everything work great.  If it still doesn't work try enabling Logging and see if that lists anything useful. -DavidSev 20:08, 1 September 2009 (UTC)
 * Although safe mode is off by default in my host, but adding a php.ini using suPHP solved my problem. I dont understand it too. Stahn85 08:24, 13 November 2009 (UTC)
 * My host has disabled passthru in disabled_functions, is it possible to run imagemagick through exec instead? 129.234.252.66 23:33, 11 December 2009 (UTC)
 * Same here. Has there been a solution in the last months? --92.224.181.255 15:54, 3 December 2010 (UTC)

Error creating thumbnail: (using rsvg)
When uploading an svg image, I get a gray background and the words "Error creating thumbnail:" but with no explanation, etc. Here's what I have in SVG related code in LocalSettings.php:

$wgFileExtensions[] = 'svg'; $wgAllowTitlesInSVG = true; $wgSVGConverter = 'rsvg'; $wgSVGConverterPath = "C:/Program Files/librsvg";

I've probably missed something stupidly important, but can someone please help??? Thanks! JonathanWiki 22:41, 27 September 2008 (UTC)
 * Anytime I try to use the |thumb command or resize an image on my newly installed board I get the following error

Error creating thumbnail:

Warning: passthru has been disabled for security reasons in /home/iptvwiki/public_html/w/includes/GlobalFunctions.php on line 2030


 * Image upload works correctly and I can display the images full size, just no resizing. I have another wiki on the same host and that one works so I don't know what the problem may be. --MasterZ
 * See above, I changed all the posts with the same question to "Error creating thumbnail:" Rumpsenate 08:00, 17 July 2009 (UTC)

Error creating thumbnail: Not able to view images of pixels more than 800*600
Hi ALL

The error that i get: Error creating thumbnail: The system cannot find the path specified. Size of this preview: 800 × 600 pixels Full resolution (2048 × 1536 pixel, file size: 813 KB, MIME type: image/jpeg)

And there is a blank grey screen, but when i click on the full resolution link, the image can be seen.This uploaded image can be seen nowhere on the wiki, even thumbnails give the same error.

Please help me on this ! --Ankit.madan 07:54, 7 September 2007 (UTC)


 * Check that you don't still have the old imagemagick code enabled. I was having this problem and realized that in a fit of idiocy I tried to comment out the imagemagick variables in localsettings with ';' instead of '#'.


 * I'm running windows server 2008, I have found that you must manually go to the ImageMagick website, download and install the program, and set $wgImageMagickConvertCommand = "C:/ImageMagick/Convert.exe"; or whatever your directory is instead of /usr/bin/convert or whatever it is, since they design it for bloody linux only
 * --Pwgus 06:17, 9 October 2009 (UTC)
 * Very large files always have this problem.
 * Here is one thread about this problem: Imagemagick will not create thumbnails for large images another: w:en:Wikipedia:Village_pump_(technical)/Archive_79 Adamtheclown 22:00, 17 January 2011 (UTC)

Error creating thumbnail: SVG Error creating thumbnail
I hate to throw my problem to the masses but I've exausted all other available resources. I'm having exacly the problem this wiki is having in rendering my svg thumbnails. I'm using CentOS 5 in 64-bit mode, apache 2.2.3, php 5.1.6, mediawiki 1.12.0, ImageMagick 6.2.8, rsvg 2.16.1

LocalSettings.php $wgFileExtensions[] = 'svg'; $wgAllowTitlesInSVG = true; $wgSVGConverter = 'rsvg'; // or ImageMagick

ImageMagick error, as seen on this other person's wiki, appears instead of the image, no .png file is created at the thumbnail location 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-XXZSRth4': 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-XXZSRth4': No such file or directory. convert: missing an image filename `PNG:/var/www/html/wiki/images/thumb/2/2c/Broom_icon.svg/400px-Broom_icon.svg.png'.

RSVG error, appearing in a log file, with a broken image on the page, no .png file is created at the thumbnail location (libcom_err.so.2 is installed through e2fsprogs-libs 1.39) /usr/bin/rsvg-convert: error while loading shared libraries: libcom_err.so.2: failed to map segment from shared object: Cannot allocate memory

Following the syntax presented in $wgSVGConverters for ImageMagick or rsvg on the command line produces the proper png file from a valid svg file. DefaultSettings.php (unchanged) $wgSVGConverters = array( 'ImageMagick' => '$path/convert -background white -geometry $width $input PNG:$output',  'rsvg' => '$path/rsvg -w$width -h$height $input $output', );

I thought I might have a permission problem. Apache run with the user apache:apache, which owns all the web files. /tmp is publicly writable. I changed /var/html/wiki/Images/thumb to be publicly writable with no effect. I'd like to use svg's, if someone has a clue please help. I have a suspision that the wiki I linked also uses CentOS in 64-bit mode.

Please don't suggest upgrading software versions unless you are absolutely sure it fixes this particular issue. Software updates on CentOS are non-trivial and have repercusions in the enterprise environment. If you have are having this issue, please also pipe in, and people might take the issue more seriously. Thanks for your time. Quadir


 * You may try to increase shell memory limits in LocalSettings.php, e.g.

$wgMaxShellMemory = 131072;
 * This helped for me with rsvg - the default 102400kB in DefaultSettings.php turned out to be a bit to small.
 * This question was asked before, with some answers:
 * Error creating thumbnail: Unable to run external programs in safe mode. (above)
 * Error creating thumbnail: convert.exe: unable to open image :Permission denied
 * User_talk:Emufarmers
 * It appears like this problem is very common, with over 9,000 pages having the same problem.
 * Rumpsenate 07:35, 17 July 2009 (UTC)

Error creating thumbnail command not found
Above is my full error, in a gray box.

See also:
 * Manual:Image_Administration
 * Manual:Errors_and_Symptoms

mwusers.com has several posts on this problem.

I also found this: Thumbnails_Not_Working

Also this posting: Using ImageMagick in Mediawiki i have to chmod 777 the image/thumb/ directory to get it working.

Rumpsenate 12:44, 17 July 2009 (UTC)

I found that this occurred because of limits being too low. I fixed it with the following setting: $wgMaxShellMemory = 202400;

Alphasee Thank you Rumpsenate. This immediately fixed my problem. I don't know why this information isn't more readily available. ^^ Fixes MediaWiki's ability to parse SVG files.

Error creating thumbnail convert: missing an image filename
I was getting this error. I checked the MediaWiki Error log and found this: thumbnail failed on hanley.site5.com: error 1 "convert: missing an image filename `/home/wiki/images/thumb/archive/4/4c/20100820211347!foo.pdf/page1-120px-foo.pdf.png' @ convert.c/ConvertImageCommand/2766." from "('/usr/bin/gs' -sDEVICE=jpeg -sOutputFile=- -dFirstPage=1 -dLastPage=1 -r150 -dBATCH -dNOPAUSE -q '/home/wiki/images/archive/4/4c/20100820211347!foo.pdf' | '/usr/bin/convert' -depth 8 -resize 120 - '/home/wiki/images/thumb/archive/4/4c/20100820211347!foo.pdf/page1-120px- foo.pdf.png') 2>&1"

So I ran gs manually: -dNOPAUSE -q '/home/wiki/images/4/4c/foo.pdf' Segmentation fault (core dumped)
 * 1) /usr/bin/gs -sDEVICE=jpeg -sOutputFile=- -dFirstPage=1 -dLastPage=1 -r150 -dBATCH \

It turns out we have a really old version of gs: GNU Ghostscript 7.07 (2003-05-17) Copyright (C) 2003 artofcode LLC, Benicia, CA. All rights reserved.
 * 1) gs -v

I ran this under gdb. definitely crashing:

I ran it under the debugger. Definitely crashing! (gdb) bt Previous frame inner to this frame (corrupt stack?)
 * 1) 0 0xaa6f4a3a in gx_device_retain  from /usr/lib/libgs.so.7
 * 2) 1 0xaa5d15ad in gx_begin_image3x_generic  from /usr/lib/libgs.so.7
 * 3) 2 0xaa5d18ae in gx_begin_image3x_generic  from /usr/lib/libgs.so.7
 * 4) 3 0xaa730d69 in gx_default_begin_typed_image  from /usr/lib/libgs.so.7
 * 5) 4 0xaa5d46e9 in art_pdf_composite_knockout_8  from /usr/lib/libgs.so.7
 * 6) 5 0xaa6fbea5 in gs_image_begin_typed  from /usr/lib/libgs.so.7
 * 7) 6 0xaa5b13dd in zimage_setup  from /usr/lib/libgs.so.7
 * 8) 7 0xaa5d0269 in s_zlib_free  from /usr/lib/libgs.so.7
 * 9) 8 0xaa5919d3 in gs_interpret  from /usr/lib/libgs.so.7
 * 10) 9 0xaa588815 in gs_main_outwrite  from /usr/lib/libgs.so.7
 * 11) 10 0xaa5889ea in gs_main_run_string_end from /usr/lib/libgs.so.7
 * 12) 11 0xaa588b29 in gs_main_run_string_with_length from /usr/lib/libgs.so.7
 * 13) 12 0xaa588b71 in gs_main_run_string from /usr/lib/libgs.so.7
 * 14) 13 0xaa58940c in errflush from /usr/lib/libgs.so.7
 * 15) 14 0xaa58979c in gs_main_run_start from /usr/lib/libgs.so.7
 * 16) 15 0xaa74318f in gxclip2_dummy from /usr/lib/libgs.so.7
 * 17) 16 0x00000003 in ??
 * 18) 17 0x00000800 in ??
 * 19) 18 0x0805899c in ??
 * 20) 19 0xbf8cc8b8 in ??
 * 21) 20 0x00000072 in ??
 * 22) 21 0xbf8cc960 in ??
 * 23) 22 0xaa411b99 in vsscanf from /lib/tls/libc.so.6

Solution: ghostscript 8.71 (from ghostscript.com). This no longer crashes. (Note: 8.64, available from the GNU site, still crashes.)

This is ghostscript bug 689150.

Error Creating Thumbnail - Image Magick Not Found
I installed Image Magick to the following directory: C:\ImageMagick

In my LocalSettings.php file are the following fields: $wgEnableUploads      = true; $wgUseImageResize     = true; $wgUseImageMagick     = true; $wgImageMagickConvertCommand = 'C:/ImageMagick/convert.exe'; $wgFileExtensions[] = 'svg'; $wgAllowTitlesInSVG = true; $wgSVGConverter = 'ImageMagick'; $wgSVGConverterPath = "C:/ImageMagick";

But when I upload a jpg, I get the following error: Error creating thumbnail: /home/content/90/5181590/html/bramtonpedia/bin/ulimit4.sh: line 4: C:/ImageMagick/convert.exe: No such file or directory

When I upload a svg, I get this message: Error creating thumbnail: /home/content/90/5181590/html/bramtonpedia/bin/ulimit4.sh: line 4: C:/ImageMagick/convert: No such file or directory

I know it's there. Why doesn't MediaWiki?

Bramton1 21:25, 7 November 2009

Error creating thumbnail (SVG) for MediaWiki 1.15.x and Windows
For weeks I have try to rasterize SVG image using 3rd party tools, and none of them work. That includes adjusting $wgMaxShellMemory, $wgSVGConverters array and etc. Opening the log reveals no specific error details on what causes it to failed. Checking out the $wfShellExec in GlobalFunctions.php reveals it could not run any command line with slashes! It had to be replaced with black slashes!

Open up your GlobalFunctions.php and look for. It should be replaced with

The  indicates to terminate program once execute that line of command.

And the output should be: } elseif ( php_uname( 's' ) == 'Windows NT' ) { # This is a hack to work around PHP's flawed invocation of cmd.exe # http://news.php.net/php.internals/21796 #$cmd = '"' . $cmd . '"'; $cmd = 'cmd /C '. '"' . str_replace( '/', '\\', $cmd) . '"'; }	wfDebug( "wfShellExec: $cmd\n" );

Also, in v1.15.x, there isn't any need to add a few variables at LocalSettings.php. All you need is to adjust variables at DefaultSettings.php. Look out for the SVG settings in it and change it accordingly.

That should work.

zaidaiman 08:53 April 10, 2010

Error creating thumbnail: ImageMagick returning exit code 2
This is likely the same problem as some of the ones mentioned before, but the symptoms look a little different, so i thought i'd add another post here.

After an OS upgrade on DreamHost, i started seeing errors like these in the log whenever ImageMagick tried to resize images (and they were small-ish JPEGs, stuff that'd always worked before):



The articles themselves just said 'Error creating thumbnail', with no other explanation.

Finding nothing on 'error 2' in either MediaWiki or ImageMagick's documentation, i decided to play with things myself, and it turned out that, as above, it was a memory-limiting problem. Doubling the default value continued to cause issues, so i'm currently doing this:

$wgMaxShellMemory = 512000;

Not sure if newer versions of ImageMagick require more memory, or if DreamHost changed something else, but that's done the job so far. — 75.173.171.241 23:10, 20 October 2011 (UTC)

Error using thumbnail: even if ImageMagick works with other Scripts.
My ImageMagick Installation uses /usr/local/IM6/bin/.

This Configuration works well at my vBulletin Forum and on Typo3 and a Joomla CMS.

I have changed this Path at my LocalSettings.php but it still says to me at the Articel:

"Fehler beim Erstellen des Vorschaubildes: sh: line 1: /usr/local/IM6/bin/: is a directory "


 * I have the same problem - any idea?
 * I think you need to point directly to convert and not just the directory it's in

Error SVG
I can't upload SVG. manual is not work.

Copy all LocalSettings.php file contents to here, please. -- WonYong ( Talk / Contrib ) 06:47, 3 March 2007 (UTC)


 * It would help if you would post the actual error message. -- Duesentrieb ⇌ 10:45, 3 March 2007 (UTC)

Error 139 (No image creation, Some memory, core error) with ImageMagic and solution
$wgMaxShellMemory  = unlimited; $wgMaxShellFileSize = unlimited; Cyber1000, 21 March 2010
 * ImageMagick itself worked on the command line, but no thumbnail creating within mediawiki(actually I got stubs containing only the header of an gif)
 * First turn on Debugging: $wgDebugLogFile    = "/tmp/wiki.log"; (before you see only stubs in the thumb folder and no more message)
 * It always said error 139, not anything more
 * I figured out it was a problem with ulimit4.sh (/usr/share/mediawiki/bin/ulimit4.sh for my Fedora-distro)
 * I didn't find another way as that ulimit -v and -f Parameter should be unlimited (If to low I got a segfault, if to high I got a "memory not allocatable" fault)
 * To achieve this behaviour:
 * These values get directly passed to the ulimit4.sh and this works for me.

The above is correct but does not include what I searched for. It was missing the key phrases of "Segmentation fault" and "core dump". I did not find it until I came to add a new section. So I am adding a bit more information. The log message I had was:

/home/johne/public_html/wiki/bin/ulimit4.sh: line 4: 20510 Segmentation fault     (core dumped) '/usr/bin/convert' -quality 80 -background white -size 120 '/home/johne/public_html/wiki/images/8/82/1978-04-29_Toronto_ticket.jpg' -thumbnail '120x65!' -depth 8 -sharpen '0x0.4' '/home/johne/public_html/wiki/images/thumb/8 I did not have to make $wgMaxShellMemory unlimited. I only doubled it. I did not touch $wgMaxShellFileSize since the size of thumbnails should be well below any file size limit imposed. JoelSherrill, 18 December 2010

Success!!! Image Thumbnailing in XAMPP 1.7.7
http://www.imagemagick.org/download/binaries/ImageMagick-6.7.5-6-Q16-windows-dll.exe extension=php_openssl.dll $wgEnableUploads = true; $wgUseImageMagick = true; $wgUseImageResize = true; $wgTmpDirectory  = true; $wgImageMagickConvertCommand = "C:/Program Files/ImageMagick-6.7.5-Q16/convert"; Note the use of forward slashes and the absence of the .exe extension in the convert binary in the last line above.
 * 1) Installed XAMPP v1.7.7 VC9 and vcredist.exe
 * 2) Installed ImageMagick for Windows from Dynamic ImageMagick from:
 * 1) OpenSSL extension DLL (Dynamic Extension) is available in XAMPP v1.7.7 but needs an entry in the php.ini file
 * 1) Restart Apache
 * 2) Setup the database and installed MediaWiki v1.18.1
 * 3) Create the tmp folder in the default mediawiki thumbnailing images path or set a custom one.
 * 4) Appended the following to the LocalSettings.php file:

Now thumbnailing will work!

Success!! Image thumbnailing

 * ko:사용자:멀뚱이/미디어위키 for korean
 * en:User:WonYong/SVG setting for english

-- WonYong Talk  04:43, 4 December 2007 (UTC)

I installed mediawiki on Windows XP I use ImageMagick-6.3.2-Q16

Following is my source file:

$wgScriptPath      = "/mediawiki";
 * 1) The URL base path to the directory containing the wiki;
 * 2) defaults for all runtime URL paths are based off of this.

$wgFileExtensions[] = 'svg'; $wgAllowTitlesInSVG = true;

$wgSVGConverters = array(   'ImageMagick' => '"C:/Program Files/ImageMagick-6.3.2-Q16/convert" -background white -geometry $width $input $output',  );

$wgSVGConverter = 'ImageMagick';


 * 1) For more information on customizing the URLs please see:
 * 2) http://www.mediawiki.org/wiki/Manual:Short_URL

$wgEnableEmail     = true; $wgEnableUserEmail = true;

Following is seemed to be Linux environment

$wgScriptPath      = "/mediawiki";
 * 1) The URL base path to the directory containing the wiki;
 * 2) defaults for all runtime URL paths are based off of this.

$wgFileExtensions[] = 'svg'; $wgAllowTitlesInSVG = true;

$wgSVGConverter = 'ImageMagick';


 * 1) For more information on customizing the URLs please see:
 * 2) http://www.mediawiki.org/wiki/Manual:Short_URL

$wgEnableEmail     = true; $wgEnableUserEmail = true;

-- WonYong ( Talk / Contrib ) 02:50, 6 March 2007 (UTC)

Image thumbnailing and resizing: intelligent program analysis of image content
Why does MediaWiki make unnecessary Thumbnails? e.g; on Image:USDA Hardiness zone map.jpg the "higher resolution" image is only slightly different from the the "thumbnail", and it is therefore wasteful to bother producing one instead of showing the actual image. --belg4mit


 * Because we suck, we're all incompetent, bad programmers, and MediaWiki is doubtless the most ridiculous piece of software out there, and thus not suitable for your use. I would strongly advise using an expensive, proprietary solution, where your developers are paid and have time to listen to unhelpful criticism. robchurch | talk 13:38, 10 July 2007 (UTC)

--


 * Peter Blaise trys a response: Hi belg4mit. I think what Rob is suggesting in his own unique and witty way is that MediaWiki is OpenSource at it's most dynamic.  So ... JUMP IN and make it what you'd prefer!  Perhaps YOU can suggest AND PROGRAM your own enhancements to the existing MediaWiki programming that would meet your needs, and benefit all subsequent users.  In other words, I think Rob is suggesting that we all stop asking others for the enhancements we want, and get to work creating the changes we want for ourselves.  And then, like the programmers before us, Rob included, upload our solutions for all others to share and improve upon.  Have I got it, Rob?  ;-)
 * So, belg4mit, I think we are all aware that "stupid" is too general a word, and could apply to programmers as well as to programs and to users, and apparently in your case, to a mismatch between your preferences and the defaults of the programmer's choices that came before you. So, make it intelligent by your standards.  Then it's up to others to asses your preferences as stupid for their own purpses or not, and improve from there.  OpenSource is messy and evolves in spits and spurts, and may never be perfect for everyone all at the same time. I think my own MediaWiki setup choices, tough appropriate for our group, might frustrate other MediaWiki users.  It's all custom.  So, belg4mit, I look forward to your contributions, and seeing your configuration settings and custom program enhancements.  Why not start a contribution list of your own at User:Belg4mit and let us keep track of your solutions and give you our useful feedback?
 * By the way, I know of no "intelligent" image manipulation program out there, anywhere, on or off MediaWiki, at any price. That is, I know of NO image program that intelligently makes decisions based upon the contents of the image, especially "smart" resizing.  If anyone knows of any such tools, PLEASE share links here, and let's see if we can incorporate them into MediaWiki.  In the meantime, I've renamed this thread from "Stupid sizing" to  "Image thumbnailing and resizing: intelligent program analysis of image content".  There are more than 1 million links resulting from a Google.com search for "+intelligent image manipulation" - overwhelming, but it's a place to start.  Essentially, it's advice to the person running any image program to do that "intelligent" analysis on their own, in their own mind's eye, before saving!  Otherwise, everyone should be advised that any image appearing on any MediaWiki screen is the result of someone's active or default choices, and may appear useful, or not, to the subsequent viewer ... and may also be dependent somewhat on the end user's browser settings and screen resolution and settings.  Check yours at http://gemal.dk/browserspy/ - mine is ~96dpi, and these letters are ~1/8th inch (~3mm).  What's yours?
 * -- Peter Blaise peterblaise 17:54, 10 July 2007 (UTC)

Uploaded SVG images don't look correct
Hi all,

I've been trying to add a couple .svg images to my new wiki (1.10), and for the life of me, I can't them to look like they do here.

For example, this is your file:



and this is what happens why I put it in my wiki (and it scales horribly, too):



I've tried this with ImageMagick and Inkscape, and they look the same. I'm guessing its a parameter in the LocalSettings file, maybe in here:

$wgSVGConverters = array(   'ImageMagick' => '"C:/Program Files/ImageMagick-6.3.5-Q16/convert" -background white -geometry $width $input $output' );

Any ideas? Nate


 * Also, is there anyone from mediawiki that could tell me what converter mediawiki.org is using? And maybe the applicable settings in the LocalSettings file? I'm certain it has something to do with that. Thanks!

--Natebsi 18:53, 18 July 2007 (UTC)


 * All the official projects use rsvg -Steve Sanbeg 18:45, 17 August 2007 (UTC)

Thumbnail circular reference
If you click on the link in this article for info on thumbnailing to go to the File Upload page, it presents a link back to this page.Michael Daly 02:36, 31 August 2007 (UTC)

How Do I Change the Default Resolution for Medium-Sized Thumbnails?
I am using a skin that sets the globalwrapper div (and hence, the main content area) to a fixed width, 850px, including the navigation menus. When I upload a large image, the medium-sized thumbnail often extends beyond the boundary of the main content area, and it looks really bad. What could I do to make the default resolution for the medium-sized thumbnail a bit smaller? I have some knowledge of PHP but don't know where to look for this setting. Thanks.

I am using the GD Library, but if I have to, I'll get Image Magick.

--Wikitonic 22:05, 27 September 2007 (UTC)

UPDATE: I checked inside the thumbnail directory and now I see that each upload is automatically resized to 5 different resolutions (180px, 300px, 350px, 500px, and 800px). So let me rephrase the question, by splitting it up into two questions. (1) How can I have MediaWiki display the 500px thumbnail instead of the 800px thumbnail when you go directly to an image's page (image:xxx.jpg)? Or, (2) Is there any way to have the resizing script create the largest thumbnail to be slightly less than 800px (e.g. 650 or 700px instead of 800px)? Either solution will work fine for me.

--Wikitonic 18:06, 1 October 2007 (UTC)


 * UPDATE: For anyone dealing with the same problem, you can find the answer at manual:$wgImageLimits.


 * --Wikitonic 15:31, 29 October 2007 (UTC)


 * Thanks for that link, that's exactly what I was looking for!


 * --97.97.177.148 00:46, 3 September 2010 (UTC)

Thumbnailing Instructions Incomplete or Inconsistent?
"To enable image thumbnailing, set ... $wgUseImageMagick to true ..." Even when using only GD?

"Make sure the $wgImageMagickConvertCommand variable points to the proper location of the convert command of your installation ...." What would this be for the GD included with WAMP?


 * Yes, I would like to ask to if you can complete it also. If the GD library is mentioned as a possible solution, if would be nice to specify this help.--Juan de Vojníkov 08:47, 19 December 2009 (UTC)

Rebuilding Thumbnails
I had permissions problems following WikiMedia installation, and no thumnails were created following importImage.php. Is there a simple admin script to sweep through to rebuild thumbnails in their hash directories? Many thanks Gaudete 15:30, 13 November 2007 (UTC)

SVG
Hello,

I have a problem with svg files on my local wiki. I have allowed the upload of the SVG files so now I can upload such files, no problem with this part. But I don't understand the 'part 2' : "Second, set $wgSVGConverter to the renderer you want to use" : I imagine that it isn't enough just to say "I want to use rsvg or magick", but that you have to install it on the server. I don't know how to do that, can anyone help me ? by advance, thanks Malta 13:36, 19 November 2007 (UTC)
 * en:User:WonYong/SVG setting I write this for you. :) -- WonYong Talk  04:40, 4 December 2007 (UTC)

Cannot delete images as Admin
Hi, I have the problem that I get an error message when trying to delete images from our wiki. It says: "Error deleting file: Could not create directory "deleted/5/t/w"." And the there is one long line with a message right in my wiki. It says that the permission is denied in a certain directory and ends with "...GlobalFunctions.php online 1670" Can anybody help me with that? My best, --Gollum 19:30, 8 December 2007 (UTC)


 * Hey Gollum, I had the same issue on my 1.11.0 instance - a 777 chmod on /images/deleted seemed to work. --Chrys 16:08, 5 January 2008 (UTC)
 * Yes, that's it! Thank you! --Gollum 00:46, 6 January 2008 (UTC)
 * In my case, all subdirectories in the images directory except the subdirectory "deleted" were owned by apache, so "chown apache:apache deleted" solved the error for me and made it possible to delete the file.

Are deleted images still stored?
I wonder if deleted images are still stored in MW 1.8.2. and if so how can I delete those deleted images? Thanks! subfader

Resizing of Some GIFs Rendering Poorly; Setting Needs Changing?
The resizing of images for thumbnails generally works great, but for some reason it does not for a small subset of images. This subset seems to be GIF images with large transparent backgrounds, e.g. logos. When they are being resized, some of the foreground is being dropped. This dropping does not occur if you resize in Photoshop. Could it be that a simple change in setting is needed?

Examples:
 * 
 * 

External applications
The notes for using external apps to render svg are a little confusing for someone unfamiliar with adding applications to web servers. I use a shared Linux server with the most recent Mediawiki loaded onto it. I'd like to use the same renderer as wikipedia, but it seems that is only for gnome environments - is that right? How (if you can?) do you install Imagemagic or anything else via ftp? Surely you don't put it on your local machine, else how will it work when other people view the svg files? Any pointers on how to get a svg renderer onto my server would be gratefully welcomed. RS

Image Renaming
Well i have done some searching and as of yet i have found a good solution or answer that will allow me to Rename an image. For the most part, until recently, the names of my images were a combined name (ie MediaWiki.jpg) instead of a representative name (ie Media_Wiki.jpg) Yes i know the underscore is evaluated as a space but it still files it as such with the underscore.

If renaming is not possible, then how about considering updating the mediawiki template to allow pictures to be considered moveable much like the other pages. Currently i am forced to delete them and upload the same image with the correct naming format.

Goldbishop 18:42, 8 April 2008 (UTC)
 * Unfortunately, image renaming is still impossible (see bug 709). —Emufarmers(T 21:26, 8 April 2008 (UTC)


 * Now it's possible, see Manual:$wgAllowImageMoving. Already enabled in MW 1.14, needs to be set to true in MW 1.13. Capmo 03:30, 3 May 2009 (UTC)

PDF Thumbnails?
I host many PDFs on my wiki, and in order to get a proper thumbnail, I first have to export the PDF as an image, upload that image, then link it to the PDF in question. Imagemagick can work with PDFs already. Here are some examples. Imagemagick itself says that it's not the best tool for vector-vector conversion, but we're not trying to do that, all we want is a preview thumbnail for uploaded PDF files, instead of that hokey adobe icon. Is it possible to add this functionality? Where in the code would it exist in the first place?
 * http://www.ibm.com/developerworks/library/l-graf2/

Rename images
I can't find any information about renaming images anywhere. My Wiki-users are uploading images without renaming them. Now I have a lot of images named "135.jpg" and other numbers. I want to rename images so that the image-name describes what's in the picture. But how? /Abbedabb 10:15, 30 May 2008 (UTC)

Use $wgAllowImageMoving = true; in LocalSettings.php. See also See15842and709

SVG on hosting server
Hello. I'm using Mediawiki on a hosting server, and i have no access to the files outside the website directory. So i don't think i can install a svg converter there.

Is there an alternative solution for enabling SVG thumbnail?

Thanks a lot. Crlf0710 07:32, 9 February 2009 (UTC)

Looking for video tutorial
I'm definitely a MediaWiki noob, so I've been looking for the for a good tutorial on ImageMagick (preferably with images or a video walkthru). Can anyone point me in the right direction? Thanks. Cannedgoods 00:01, 23 March 2009 (UTC)


 * You don't need to know anything about ImageMagick to use it with MediaWiki; you just need to download and install it (you might be able to use your operating system's package manager instead). —Emufarmers(T 20:27, 24 March 2009 (UTC)


 * You mean to istall it to the web server? How?--Juan de Vojníkov 14:07, 20 December 2009 (UTC)

Which renderer ?
Which renderer do the wikimedia sites including commons and wikipedia use as their svg renderer?


 * anyone know?

librsvg --NachoDuck 15:52, 7 September 2010 (UTC)

Batik refuses to render SVG images.
Using: Mediawiki version 1.15.1, OS: Ubuntu 8.04.3 LTS, PHP 5.2.4, Apache 2.2.8

Attempting to render SVG graphics I get this error instead of the thumbnail or image:

Error creating thumbnail: Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.batik.i18n.LocalizableSupport at org.apache.batik.apps.rasterizer.Messages. (Messages.java:48) at java.lang.Class.initializeClass(libgcj.so.81) at org.apache.batik.apps.rasterizer.Main. (Main.java:299) at java.lang.Class.initializeClass(libgcj.so.81)

Have downloaded batik 1.7 binaries, and have decompressed (using JAR) to /usr/share/java/ This seems to make MediaWiki reference and use the Batik java system, as I was receiving a completely different error before regarding the rasterizer jar file not being found. Now with the change, it spits the aforementioned error.

Have entered in LocalSettings.php: $wgAllowTitlesInSVG = true; $wgSVGConverter = batik; $wgSVGConverterPath = "/usr/share/java/";

Have searched everywhere on the web - no clues. Can break it further by removing the Java files, so this proves the Java is being loaded for Batik. It just doesn't work.

Could this be a missing dependency in Ubuntu, rather than an actual code problem?

As this is breaking my head for 2 days now I'm going to ditch Batik as it has wasted my time. I write this in the hope I can help someone else avoid using this mistake piece of software.

Update: I have successfully rendered SVG images using ImageMagick. Initial configuration: $wgAllowTitlesInSVG = true; $wgSVGConverter = 'ImageMagick'; $wgSVGConverterPath = "/usr/bin/";

This did not work straight away, due to missing dependency: libwmf-bin This provided previously missing wmf2eps binary.

I employed this change to LocalSettings.php:

$wgMaxShellMemory = 131072;

And used chmod 777 on the thumb directory under the images directory.

eg: chmod 777 /usr/share/mediawiki-1.15.1/images/thumb

And now all is working well.

I say the main page for SVG images should recommend ImageMagick. I dont understand why it is considered to do a poor job, seems to work just fine here.

Using browser scaling for PNG thumbnails
I hacked my old MW 1.8.x to use the *actual* PNG image and let the browser scale it downward for thumbnails, as the bundled GD library seemed to fail miserably when it came to creating anything comparable in quality to that of JPG thumbnails (even when I upgraded GD to the latest version). ImageMagick wasn't an option for me. I present it here in the hope that in the future we can skip PNG thumbnailing via a config option, given how many problems I've read about it in various discussion groups.

File:    includes/Image.php Function: function getThumbnail( $width, $height=-1, $render = true ) { Find: if ( $render ) { $thumb = $this->renderThumb( $width ); Replace with: if ( $render ) { if ( $this->getMimeType == 'image/png' ) { $thumb = new ThumbnailImage( $this->getURL, $width, $height ); } else { $thumb = $this->renderThumb( $width ); }

File:    includes/Linker.php Function: function makeThumbLinkObj( $img, $label = '', $alt, $align = 'right', $boxwidth = 180, $boxheight=false, $framed=false, $manual_thumb = "" ) { Find: $s .= ''. ''; Replace with: $s .= ''. '<img xtest=0 src="'.$thumbUrl.'" alt="'.$alt.'" '. 'width="'.$boxwidth.'" xheight="'.$boxheight.'" '. 'longdesc="'.$u.'" /></a>';

In case the change in the second file isn't obvious: I intentionally broke height parameter, as the '-1' default was causing the browser to correctly render the original image as a thumbnail, albeit with a corrected height of 1px; not specifying height leaves the browser to render the thumbnail image height according to its aspect ratio. Tested on IE only. --Gth-au 04:13, 3 November 2009 (UTC)

Ban on creation of thumbnails format .gif
Hello! The problem is that if I load the image, the size of 1mb, miniature get much larger. Please'll show how to disable the creation of thumbnails for .gif. How to reduce the quality of thumbnails? Why miniature size larger than the original?

Example original 56Kb, miniature 328kb!

Can't make librsvg work.
I have downloaded the latest snapshot of RSVG. Uploaded the librsvg folder on my shared hosting account in Godaddy: /webwiki/svgconverter/. And added the $wgSVGConverterPath = "$IP/svgconverter/librsvg"; and $wgSVGConverter = 'rsvg'; in the LocalSettings.php. Unfortunately,

Error creating thumbnail: /home/content/94/4582794/html/webwiki/bin/ulimit4.sh: line 4: /home/content/94/4582794/html/webwiki /svgconverter/rsvg: No such file or directory

I think i am doing something wrong with librsvg. I can't find any reliable documentation on how to use it.


 * I take it you're on a shared hosting service (judging by your mention of GoDaddy and the error you provided). librsvg needs to be installed on the server and requires root access to do so, you might want to ask your host if it's installed and what the current path to it is. --NachoDuck 15:56, 7 September 2010 (UTC)

Can't disable the SVG render
I want to use svg images in my wiki, but the render can not be shut down. That's anoying as hell, because everyone who uses the wiki has a firefox 3.x and so svg images can be viewed crystal clear with native support.

LocalSettings.php for image folder symlink
Hi, I have two websites on the same topic and I am trying to use one image folder so that both websites can share the same images. I have used symlinks for one website (kesihatan) pointing to the image folder of the other website (health). What else do I need to do? I tried: $wgUploadPath      = "images"; $wgUploadDirectory = "images"; $wgAllowExternalImages = true;

but it is not working. I also tried
 * $wgUploadPath      = "../health/images";

Any help deeply appreciated. &mdash; PM Poon 20:55, 10 June 2011 (UTC)


 * I think you may be looking for Wiki family. Beta M 15:57, 11 July 2011 (UTC)

Thumbnailg animated PNGs
It seems like blogger and blogspot are able to keep the animation in animated PNGs when they are resized. Is there a way to get this working on MediaWiki?

Problems rasterizing SVG files
Hi. If anyone happen to be stack with old version of rsvg (like in CentOS 5) and you have probelms with national/local/special characters then there is hope!

First you add this to LocalSettings.php:

This BTW speeds up processing image pages A LOT.

Then - if you still have problems - you should change your includes/media/SVG.php file so that rasterize function is:

Note that I use MW 1.16.0. You should change this code if you other version. Note that the added code is in globals and in between // Nux: Asciify Svg File Before Rasterize</tt>.

Cheers, Nux 16:22, 7 November 2011 (UTC).

Batik does not handle with long css sections
This took me a while to figure out: Batik will only parse the first hundred or so css rules, and then finish the rendering with no error message. I finally had to switch to ImageMagic to make everything work. rotsee 10:10, 11 November 2011 (UTC)

opensuse + rsvg
MediaWiki 1.17 and 1.18 on openSUSE 11.4 with rsvg 2.32.1

Encoding problem with non-ASCII svg file names.

this worked with params: $wgSVGConverters = array( 'rsvg' => 'rsvg-convert -w $width -h $height $input > $output'); $wgSVGConverter = 'rsvg'; but not worked with: $wgSVGConverters = array( 'rsvg' => 'rsvg-convert -w $width -h $height $input -o $output'); and $wgSVGConverters = array( 'rsvg' => 'rsvg -w $width -h $height $input $output'); also work fine in terminal: > rsvg-convert -w 200 -h 60 проба.png -o проба.svg > rsvg -w 200 -h 60 -o проба.svg проба.png --Pastakhov 09:34, 9 January 2012 (UTC)

How to change default image upload description? (question)
How to "properly" change default file description that shows before you upload image (like on wikipedia.org) - for few wikimedia releases I've been doing it by changing includes/specials/SpecialUpload.php And adding almanach_return_empty_file_description to LocalSettings.php with desired return value, but this requires changed on every update - is there more "proper" way to do it? Sauron (talk) 08:22, 19 February 2012 (UTC)