I installed the extension and it says it is installed. What do I do now?
Extension talk:NativeSvgHandler
Appearance
Nothing, it should already be working. You can confirm this by checking if any image embed of an SVG image is itself an SVG.
After saving a file with the draw.io extension it displays all the shapes but no text.
MediaWiki | 1.35.8 |
PHP | 7.4.32 (fpm-fcgi) |
MySQL | 5.7.40 |
ICU | 63.1 |
Do you have a live page that I can check?
I dont, its a private wiki..
But apparently there has been this issue. Have not really read into it
https://phabricator.wikimedia.org/tag/mediawiki-extensions-drawioeditor/
Looking at the tasks opened with drawioeditor, it seems that the issue is on their end with how the SVG is exported (T271347).
It did work with that workaround actually. Both of our links had the same solution in the comments.
Thanks
NativeSvgHandler ignores custom SVG image dimensions set while rendering SVG in Visual Editor. For example, in Visual Editor "File:sample.svg|20x20px" is rendered full-size (200x200), not 20x20. Mediawiki 1.31-1.34.
It does not ignore custom SVG dimension. It is VE that ignore the size attributes set on the <img> tags. VE is taking the intrinsic size of the SVG. If your original SVG is 200x200px even though you set it is 20x20px in the wiki, VE will ignore the size and render as 200x200px instead.
I'm not familiar enough with VE to work out a fix on it, maybe someone can take a look?
Ideally this should be in a bugreport (if not already reported), so the relevant team is aware of that, and track the status of the problem.
Just installed it (MW 1.35.1) and on a Wiki using TinyMCE editor (on a shared hosting)
Wiki code: Display size works fine using the file/image command. Gallery also works, except for the "packed mode" it seems. So it's indeed a VE issue, but not a wiki issue.
TinyMCE Editor: It seems to be able to handle the SVG (including setting the size). However, this editor cannot handle gallery.
Anyhow, thanx for pushing SVG since this extensions allows to display crisp schemas. I need to do some more testing, but for the moment I adopted it :) - Daniel K. Schneider (talk) 17:20, 7 May 2021 (UTC)
Can you just put some svg tags around your svg code and get an image?
I too am curious how this works. I've tried uploading svg files, embedding <svg>...</svg> payloads directly in the source editor and embedding URIs to remotely hosted svg files, all without any success. LocalSettings.php:
wfLoadExtension('NativeSvgHandler');
$wgFileExtensions[] = 'svg';
Since it is a file handler you need to upload the SVG File. The Handler skips the JPG/PNG-thumbnail-process and delivers instead the SVG in a direct way.
For inline SVG was another extension ..
https://www.mediawiki.org/w/index.php?title=Extension:Inline_SVG_extension&oldid=2490064
it's unmaintained and was sweeped.
Nice stuff. Could you add support for the link parameter?
This post was posted by Kghbln, but signed as Tom Edwards.
Seconded.
SVG files display well, but the image is not wrapped in a link to the file page. This includes thumbnails in the category view which seriously reduces operability.
I had this same problem, so I hacked the code quickly: added link wrapper, copied from base MediaTransformOutput class, https://doc.wikimedia.org/mediawiki-core/master/php/html/MediaTransformOutput_8php_source.html
I've submitted a pull request, but in the meantime, interested parties can get my copy from https://github.com/kvand/NativeSvgHandler.
I am using mediawiki on my local NAS. This NAS is a Synology NAS. Synology provides additional software packages similar to the extensions here. One of this packages is a Mediawiki installation. This works fine, so far. Unfortunately the provided Mediawiki version is still 1.30.0. I do not want to fiddle around with updating this installation because I do not know what will happen, if there comes a regular update by Synology.
But I want to use SVG images. I did not manage to get a SVG rendering software up and running. And since this wiki is only presented locally, my browser can do this job. This software seems to be the extension to make this work. I used an old version of this extension in a first mediawiki attempt on my NAS. That version works. But now this version is not available anymore here. I can only download the lastest version. And that version is fully incompatible with Mediawiki 1.30.0.
Is there a way to get hands on a version that is compatible to 1.30.0? Many thanks for an answer in advance!
First of all, you should urge Synology to update MediaWiki, as MW 1.30 reached end of life nine months ago, and it wasn’t even an LTS version (see Version lifecycle). If it’s impossible, https://github.com/wikimedia/mediawiki-extensions-NativeSvgHandler/tree/df0a5b903f seems to be a pre-1.31 version (a way pre-1.31 one: its last commit was before the release of MW 1.27). You can download it using the “Clone or download” button.
@Wgkderdicke Hi there! I created a new branch called legacy for version before 1.31, you can find it both on Gerrit and Github.
Note that the installation for the old version is a bit different, instead of using wfLoadExtension( 'NativeSvgHandler' );
, you will need to use require_once "$IP/extensions/NativeSvgHandler/NativeSvgHandler.php";
instead.
Just like @Tacsipacsi mentioned, you should urge Synology to update Mediawiki at least to the latest LTS version (1.31.6) as the 1.30.0 is not in support and it is never a LTS nor the latest version in 1.30 either.
Thanks for your answers. I managed to get that old version running. The update issue seems already to be a topic.
There are no older topics