Item13908: ImagePlugin problems with svg images
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
Demo of the problem
Image
psgi_mw_app.svg
attached to:
QuoVadisPsgiFoswikiImages.
- Using plain <img src='http://translate.foswiki.org/pub/Development/QuoVadisPsgiFoswikiImages/psgi_mw_app.svg' width='500' />
-
- using the IMG tag and the SRC is another topic - the image is OK
Locally attached the same image using:
- <img src='http://translate.foswiki.org/pub/Tasks/Item13908/psgi_mw_app.svg' width='500' />
-
- locally attached the same image - screwed
The image is screwed with the
ImagePlugin, when it is attached to the local topic. Images attached to the other topic are ok.
Also, the "cached" version is
much bigger (150kb) than the original (8kb) svg.
--
JozefMojzis - 30 Dec 2015
I just stumbled on the same problem.
It is a strange bug. I tried to add "svg" to the list of formats recognized by isWebby, I even added a return at the start of takeOutSVG to disable svg interpretation, but the problem persisted. A workaround was to use a object html tag to encapsulate the SVG file and make it bypass ImagePlugin autodetection.
In our instance, for the same svg file attached to the topic, using just the path in the <IMG src="..." triggered the bug (rendering the SVG file in a crappy resolution), altough the ConvertInlineSVG setting was set to 0. But using the whole <IMG src="http://host/path..." worked: the svg was rendered by the browser. Using an <object src="..." tag also worked.
As our users actually did not use this plugin currently, but we had lots of SVG files, I disabled ImagePlugin in our install, this bug made it unusable.
--
ColasNahaboo - 10 Sep 2018
Hm, adding svg to
isWebby()
actually fixed it for me. Which
%IMAGE
command did you use for the svg file?
--
MichaelDaum - 10 Sep 2018
No %IMAGE command. It was just plain IMG tags as provided by the attach command, e.g:
<img src="the-url-of-the-attached-svg-file.svg" />
This is why I disabled the plugin: I saw that no page had currently %IMAGE in them
--
ColasNahaboo - 12 Sep 2018
Try disabling
{ImagePlugin}{RenderLocalImages}
. This will stop processing
<img ...>
tags.
--
MichaelDaum - 13 Sep 2018
Ah, it worked!
--
ColasNahaboo - 13 Sep 2018
--
MichaelDaum - 13 Sep 2018