[bt-devel] SVG to PNG conversion: try Inkscape

Jonathan Marsden jmarsden at fastmail.fm
Fri Feb 27 20:11:54 MST 2009


Greg Hellings wrote, quoting me:

>> If you need me to email you a tar.gz (or even a .zip) file containing
>> all 79 .png files I created (in about 14 seconds) by running the above
>> command in my bibletime-1.7 pics/icons/ directory, let me know :)

> Probably the better thing to do would be to provide them to Eeli, so
> he can test them and then decide whether or not to include them with
> the actual Subversion.

Hmmm.  The smiley there was intended to indicate that it shouldn't
really be necessary to do that, because generating the PNGs for yourself
is so straightforward, now that you know about Inkscape.

Further, as I see it, the PNG files are derived from the SVG, and are a
less desirable form in terms of further editing (being raster graphics
not vector).  So the SVG files should be considered the "source form" of
the images, and stored in the VCS.  Cmake or whatever build tools are in
use should generate PNG files as part of the build process, if having
PNG files for these icons at install time is desired.  You really do not
want to have to keep and track two sets of icons in your VCS, differing
only in graphics file format -- it's highly likely that at some point
they will get out of sync with each other and cause confusion, or
hard-to-track-down bugs.

Meanwhile anyone at all who can download and install inkscape and run a
one liner (which might be a 3 or 4 liner in DOS) can generate a full set
of PNG icons for BT testing purposes, so on Ubuntu Linux in a bash shell:

  sudo apt-get install inkscape
  cd ~/bibletime-1.7 # Or wherever you keep your BT source tree
  cd pics/icons
  for i in *.svg ; do inkscape $i -e ${i/.svg/.png} ; done

is all it takes; and that's easier than my emailing binary files around
at all, and this approach "teaches people to fish" rather than just
handing them a single meal... :)

Why don't you try this (or its Windows equivalent) and report your
results back to the team?  If you get totally stuck, then and only then
download http://computeroptions.net/bibletime-pngs.tar.gz and test with
those instead.  Eeli can do the same, of course.

> If, indeed, there are problems with the SVG files, as has been
> indicated by Gary and yourself, then perhaps running the png files in
> there would alleviate those warning messages as well as give us
> rendering on Windows.

It very likely would; but that's a side-effect of using PNG files, not a
design goal!  The missing or corrupted linearGradient information in
some of the SVG files may be causing imperfections in the displayed
graphics.  The right fix for those warnings is surely to have the team
graphics guru (I have no idea who originally created or edited these
icons!) check and correct the actual SVG files, and *then* the build
process can automatically create PNG raster files from the corrected
vector graphics files.  Then cmake could set things up and run makensis
to create a pretty little Windows BT installer .exe file which includes
and installs those PNGs, for instance!

Please do not be tempted to "sweep the dirt under the rug" here... if
there are issues with the SVG files, the team should admit that, and
work to fix them.

Jonathan



More information about the bt-devel mailing list