SVG support via rsvg-convert.exe
Moderators: XnTriq, helmut, xnview
-
- Posts: 44
- Joined: Fri Dec 13, 2013 6:31 am
SVG support via rsvg-convert.exe
As , besides being shareware, the CADImage plugin is quite bad at decoding SVG properly if at all (those I make anyway) I would suggest supporting SVG, in the vein of BPG support via bpgdec.exe, with rsvg-convert.exe instead. It's fast, decode everything I throw at it correctly and is is available compiled for win32 with recent source here:
https://sourceforge.net/projects/tumagc ... z/download
Command line is: input.svg -o output.png
If having a console flashing at each new file is a concern, then I guess that simply changing the subsystem flag in the PE header from console to GUI would eliminate this issue. I did that with the bundled bpgdec.exe and I don't have consoles flashing anymore when viewing bpg files in XnView.
Thanks.
https://sourceforge.net/projects/tumagc ... z/download
Command line is: input.svg -o output.png
If having a console flashing at each new file is a concern, then I guess that simply changing the subsystem flag in the PE header from console to GUI would eliminate this issue. I did that with the bundled bpgdec.exe and I don't have consoles flashing anymore when viewing bpg files in XnView.
Thanks.
-
- XnThusiast
- Posts: 2005
- Joined: Tue Jul 17, 2007 1:17 am
- Location: France
Re: SVG support via rsvg-convert.exe
+1captaincavern wrote:... the CADImage plugin is quite bad at decoding SVG properly ...
XnViewMP Linux X64 - Debian - X64
-
- Posts: 127
- Joined: Thu Feb 10, 2011 1:52 pm
- Location: Hamburg
Re: SVG support via rsvg-convert.exe
That's a nice tool, I often used it to convert odd SVGs (identified as invalid by the W3C validator) to good enough valid SVGs for the purposes of Wikimedia commons. For some background info see enwiki.captaincavern wrote:https://sourceforge.net/projects/tumagc ... z/download
But I don't get why you want to start a conversion from SVG to PNG within XnView.
-
- Posts: 127
- Joined: Thu Feb 10, 2011 1:52 pm
- Location: Hamburg
Re: SVG support via rsvg-convert.exe
Bump, great idea, the BPGdec.exe console window open/close is slightly annoying in folders with many BPG images. And of course librsvg-convert.exe is still good (2.40.9, I haven't tested the new 2.40.12 yet.)captaincavern wrote:If having a console flashing at each new file is a concern, then I guess that simply changing the subsystem flag in the PE header from console to GUI would eliminate this issue. I did that with the bundled bpgdec.exe and I don't have consoles flashing anymore when viewing bpg files in XnView.
Thanks.
Back to BPG: XnView 2.34 still had BPG 0.9.5. The newest version as of today is 0.9.6, just copying BPGdec.exe + libjpg-62.dll + libpng16-16.dll + zlib1.dll to the XnView/plugins folder is enough to "install" it as far as XnView is concerned. The old libpng15-15.dll can go to the bin. JFTR, both libpng used by BPG are obsolete, and so far I failed to create a BPG with an "RGB is GBR" colour profile from a PNG with this feature. Presumably it was no XnView issue, BPGview.exe also didn't display the expected colours.
About the stupid byte wanting to be fixed to get rid of the console window open/close: Some obscure tool known as editbin.exe can do this, and after about an hour with even more obscure downloads I managed to locate it in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin. Where it still failed, because it's just a wrapper for some link.exe, but not the Open Watcom idea of link.exe After running vcvars32 in the VC/bin folder editbin.exe in the same folder was finally ready for action:
Code: Select all
editbin /SUBSYSTEM:Windows "c:\Program Files (x86)\XnView\PlugIns\bpgdec.exe"
-
- Posts: 44
- Joined: Fri Dec 13, 2013 6:31 am
Re: SVG support via rsvg-convert.exe
Sorry, I should have mentioned there is an easy to use GUI tool to change the subsystem flag in executable headers. That's NW PE Builder: http://www.woodmann.com/collaborative/t ... PE_Builder. The subsystem value needs to be changed from 3 to 2.
It's nice you've discovered another way however.
It's nice you've discovered another way however.
-
- Posts: 44
- Joined: Fri Dec 13, 2013 6:31 am
Re: SVG support via rsvg-convert.exe
Well this tool only ouputs png data if I am not mistaken so I thought XnView could direct it to render a png to a temp folder and then read the png from there but perhaps it can output to stdout (not sure) which would avoid writing a temp file to disk.omniplex wrote:But I don't get why you want to start a conversion from SVG to PNG within XnView.
Anyway it doesn't seem there is any interest in implementing that either way. .
-
- Posts: 127
- Joined: Thu Feb 10, 2011 1:52 pm
- Location: Hamburg
Re: SVG support via rsvg-convert.exe
New version (not yet tested) 2.40.13.captaincavern wrote:it doesn't seem there is any interest in implementing that either way. .
But BPG is still at 0.9.6, with an allegedly obsolete libpng, and no known example with an ICC color profile working for me. FFMpeg 3.0 still doesn't support BPG at all, now I wonder if it's still alive.
-
- Posts: 44
- Joined: Fri Dec 13, 2013 6:31 am
Re: SVG support via rsvg-convert.exe
All here for example: http://ftp5.gwdg.de/pub/opensuse/reposi ... 12/noarch/
Fetch the librsvg packages (and the many packages it depends on).
Fetch the librsvg packages (and the many packages it depends on).
-
- Posts: 44
- Joined: Fri Dec 13, 2013 6:31 am
Re: SVG support via rsvg-convert.exe
Looks like I was too pessimistic.captaincavern wrote:Anyway it doesn't seem there is any interest in implementing that either way. .
Thanks Pierre for adding this to new XnView build.
-
- Posts: 17
- Joined: Sun Jun 19, 2016 7:29 pm
Re: SVG support via rsvg-convert.exe
Hi!
Once again for the dummies please...
I put the rsvg-convert.exe into the XnView Plugins folder and what do I have to do now?
XnView didn't recoginize it (it's not a dll...), but it needs to be connected somehow to automatically convert the svgs.
Thanks,
Hanswurst
Once again for the dummies please...
I put the rsvg-convert.exe into the XnView Plugins folder and what do I have to do now?
XnView didn't recoginize it (it's not a dll...), but it needs to be connected somehow to automatically convert the svgs.
Thanks,
Hanswurst
-
- Author of XnView
- Posts: 44922
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: SVG support via rsvg-convert.exe
XnView recognizes it automatically. Could you send me a svg that you are trying to load?Hanswurst wrote:Hi!
Once again for the dummies please...
I put the rsvg-convert.exe into the XnView Plugins folder and what do I have to do now?
XnView didn't recoginize it (it's not a dll...), but it needs to be connected somehow to automatically convert the svgs.
Pierre.
-
- Posts: 17
- Joined: Sun Jun 19, 2016 7:29 pm
Re: SVG support via rsvg-convert.exe
It happened with any svg.
But now it works: Tools --> Options --> General --> Display all image file types, Program restart
Strange option... should be active by default? Nevermind.
It still does not appear in the plugins or addons list.
Yes, a command prompt flashes for a fraction of a second but that's just a cosmetic point and I'm happy the way it works now!
thanks
But now it works: Tools --> Options --> General --> Display all image file types, Program restart
Strange option... should be active by default? Nevermind.
It still does not appear in the plugins or addons list.
Yes, a command prompt flashes for a fraction of a second but that's just a cosmetic point and I'm happy the way it works now!
thanks