Qt SVG renderer

Luciano Montanaro mikelima at cirulla.net
Mon Aug 4 22:18:43 BST 2008

On Monday 04 August 2008, Ingo Klöcker wrote:
> On Monday 04 August 2008, Thiago Macieira wrote:
> > On Monday 04 August 2008 14:45:42 Sascha Peilicke wrote:
> > > Le Monday, 4. August 2008 11:01:46 John Tapsell, vous avez écrit :
> > > > > Thanks for the list. it looks like a fair amount of
> > > > > misrenderings can be fixed in the svg itself - there is for
> > > > > example no reason why weather-clouds- night.png contains a
> > > > > printer logo in the background (which is apparently a layer
> > > > > labelled inactive, so it is not rendered by inkscape).
> > > >
> > > > Would it be a simple sed script to remove inactive layers from
> > > > all svgs?  We could have a kde_fix_svg  script or something
> > >
> > > And wouldn't that add some benefits like reduced SVG filesize and
> > > loading/parsing time?
> >
> > Be careful not to throw away information that the artists use to edit
> > the file.
> >
> > It's all and well to do a garbage collection, but not to make the
> > file impossible to edit later.
> I don't see the problem. If the clean-up can be performed by a script
> then it can easily be done when the packages for distribution are
> created. When we create tarballs of our source code we also throw away
> some files that are only necessary for the developers working with SVN,
> but not for just building the binaries (or at least we did so in the
> past when we still used autofoo+configure). Moreover, the distributors
> all the time create packages of files that are impossible to edit. But
> that's no problem because the creation of the binaries does not make
> the source code files vanish. And then there are the translation
> files...
> IOW, almost anything we edit is later converted (by us or the
> distributors) to something one cannot edit anymore. So why not do the
> same for the SVGs?
> Regards,
> Ingo

If you are interested, I have a command line Qt program that does this kind of 
filtering/optimization. It managed to cut a good chunk off the svg icons file.
Once compressed, the svg files are probably 10-20% smaller than the 
original... although the uncompressed svgs are typically much smaller, so the 
parsing should be quicker. I tink it made some difference in kgoldrunner 
backgrounds loading, although we considered it would make it harder for 
potential contributors to reuse the graphics. Plus, with the new pixmap cache
code in kgoldrunner it was not so important anymore...


Luciano Montanaro //
                \X/ mikelima at cirulla.net

More information about the kde-core-devel mailing list