[Kde-games-devel] A simple svg optimizer

Parker Coates parker.coates at gmail.com
Sun Mar 9 23:25:49 CET 2008


On Sat, Dec 22, 2007 at 8:16 PM, Luciano Montanaro <mikelima at gmail.com> wrote:
> Well, my idea was to use the optimizer as part of the installation process, so
> the "source" SVG files would still contain the complete editable version.
>
> Mauricio main objection was that a contributor would have access to a worse
> copy of the data files as a starting point. Which is a valid concern.
>
> However, I think a better way to attract/help contributors is to point them to
> a wiki page (or something similar) with instructions and a few templates --
> or the "source" files for the shipped themes. At the moment I think it's
> quite difficult for the casual user to find out where the data files are
> stored, and the conventions that need to be respected -- the source files are
> at least organized per application.
>
> Luciano


Hello all,

I realise this is a very old thread, but I've been thinking about this
issue quite a bit lately, so I'm going to revive it. Luciano, I'm not
sure if you've made any more progress on your optimiser since it was
last discussed. If so, please share.

I think I've come up with a relatively simple way of solving
Mauricio's issue of users unknowingly trying to edit lesser copies of
the artwork. The optimiser simply has to add the following lines to
the end of the SVG file (just before the closing </svg> tag).

<text x="0" y="100" style="font-family:Sans
Serif;font-size:100px;fill:#f0f;stroke:#000;stroke-opacity:0.5;stroke-width:2">
	<tspan x="0" y="100">This file has been stripped down and </tspan>
	<tspan x="0" y="225">compressed to optimize its file size and </tspan>
	<tspan x="0" y="350">loading time. If you wish to edit this </tspan>
	<tspan x="0" y="475">image, we strongly recommend getting </tspan>
	<tspan x="0" y="600">the original file with full meta data </tspan>
	<tspan x="0" y="725">from http://websvn.kde.org.</tspan>
</text>

That will add a really big, really magenta, really hard to miss
warning to the SVG. As it's at the end of the file and starts at the
top left corner it should overlay all other file content. See the
attached screenshot of inserting this in a KMines theme.

Of course, I'm open to suggestions on the message text and the URL is
just a placeholder. Maybe it could point to a page of instructions on
games.kde.org or techbase.kde.org. Or maybe it could be passed as a
argument to the optimiser, in which case maybe some CMake and SVN
magic could be used to automatically generate a websvn URL.

Also, if we succeed in getting this optimiser worked into our build
process, I think we should consider switching to using uncompressed
SVGs in SVN and compressing them only at install, after the
optimisation. That would give the advantage of meaningful diffs in
SVN.

Parker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: svgWarning2.png
Type: image/png
Size: 120335 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20080309/c54d4f39/attachment-0001.png 


More information about the kde-games-devel mailing list