You are here: Foswiki>Tasks Web>Item13908 (13 Sep 2018, MichaelDaum)Edit Attach

Item13908: ImagePlugin problems with svg images

pencil
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: ImagePlugin
Branches:
Reported By: JozefMojzis
Waiting For:
Last Change By: MichaelDaum

Demo of the problem

Image psgi_mw_app.svg attached to: QuoVadisPsgiFoswikiImages.

  • Using plain <img src='http://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://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

smile

-- MichaelDaum - 13 Sep 2018
 

ItemTemplate edit

Summary ImagePlugin problems with svg images
ReportedBy JozefMojzis
Codebase
SVN Range
AppliesTo Extension
Component ImagePlugin
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic attachments
I Attachment Action Size Date Who Comment
psgi_mw_app.svgsvg psgi_mw_app.svg manage 8 K 30 Dec 2015 - 14:10 JozefMojzis  
screenshot_08.pngpng screenshot_08.png manage 85 K 30 Dec 2015 - 14:18 JozefMojzis chrome screenshot
screenshot_09.pngpng screenshot_09.png manage 96 K 30 Dec 2015 - 14:19 JozefMojzis safari screenshot
Topic revision: r9 - 13 Sep 2018, MichaelDaum - This page was cached on 14 Jan 2020 - 18:25.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy