Hi there!
SVG uploads have been broken on the SL Wiki since
September 2022
. This was reported on the Jira [the link is to the archived Jira].
To reproduce, all that is needed is to search for SVGs on the file library. Almost all (and all from September 2022 onwards) will appear to be broken.
Here is a (slightly more recent) test from October 2023: https://wiki.secondlife.com/wiki/File:Second_Life_Logo.svg
And the error given is:
Error creating thumbnail: convert-im6.q16: delegate failed `'rsvg-convert' -o '%o' '%i'' @ error/delegate.c/InvokeDelegate/1928. convert-im6.q16: unable to open file `/tmp/magick-4352gcUpm5k4VXzw': No such file or directory @ error/constitute.c/ReadImage/600. convert-im6.q16: no images defined `PNG:/tmp/transform_553c1ae0c6da.png' @ error/convert.c/ConvertImageCommand/3258.
This is an error message from ImageMagick 6, used to resize thumbnails, and a prerequisite for uploading images. With all other (supported) image types (including WebP!) everything works without errors, because all of those are natively supported by ImageMagick (i.e., they're built-in modules).
Several other graphic file formats — the most obvious and pertinent of those being SVG, but others, such as PDF, might have similar issues — aren't natively handled by ImageMagick; rather, depending on the underlying operating system, they are handled by what ImageMagick calls
delegates
. A delegate is simply an external tool which converts first the 'foreign' file to a format that ImageMagick can handle natively; this will then be further processed by ImageMagick (and all its, well,
magic
, applied as normal). In other words: for SVGs, the
first
step in the complex ImageMagick pipeline is to convert the file to something ImageMagick can process.
Usually, that means rasterising the vector file to an adequate size. On macOS, for instance, for some reason, my MacBook Pro uses Inkscape; on Ubuntu and Debian Linux,
rsvg-convert
is more common.
The full delegate lis can be retrieved from a file called
delegates.xml
which, under Debian and Ubuntu, is found under
/etc/ImageMagick-X/
(where X is the ImageMagick version — 6 in the case of the SL Wiki). This should also list the kind of command arguments passed to
rsvg-convert
.
What
seems
to be happening is that
rsvg-convert
is being correctly called, but it's unable to write a temporary file (the intermediary conversion file to a raster format) on
/tmp
— possibly because the process running the MediaWiki PHP does not have read/write access to
/tmp
— and therefore is unable to pass the results back to ImageMagick.
Please note that the MediaWiki installation
may
be using the ImageMagick module for PHP, as opposed to launching an external process; this means that common file formats are handled directly inside PHP itself. External delegates, however, need to be spawned; and it's very likely that the PHP support on that server does not have direct access to
/tmp
, and, therefore, anything spawned by it will inherit its permissions (or lack thereof).
Also note that the upload itself didn't fail: the SVG
has
been correctly stored — the link is obtained by clicking on the Time/Date column of the
File: Second_Life_Logo.svg
page. It's
only
the thumbnail that is broken; but without a valid thumbnail, nothing works on the SL Wiki.
This should be a very easy fix! After all,
before
September 2022, there was no problem in uploading SVGs. But now all are broken.