Qt SVG renderer

James Richard Tyrer tyrerj at acm.org
Mon Aug 4 20:43:38 BST 2008


Matthew Woehlke wrote:
> James Richard Tyrer wrote:
>> Matthew Woehlke wrote:
>>
>>> Well *I'm* still curious. So I dug out where in svn the .svg's are... 
>>> and at least for media-flash-memory-stick, there is indeed *not* junk 
>>> in the file... 
>>
>> I disagree.
> 
> What exactly is the difference between the version you attached and the 
> one in svn? All I can tell from a cursory inspection is that you 
> ungrouped some objects. While this may reduce the file size (and could 
> be considered cruft), it is NOT a collection of additional stray 
> elements (i.e. entire unrelated icons) that I was calling "junk".
> 
> I disagree with you disagreeing.
> 
I would have thought that a file of less than half the size with the 
*exact* same result would be QED to the question of whether there was 
junk in the file without any explanation.

The question which I was addressing was whether there was junk in the 
file.  Since I removed 6154 bytes from a 11823 byte file (a 52% 
reduction in the file size), it should be obvious that there was junk in 
the file.  Whether or not this is the cause of improper rendering is not 
the question which I was addressing.

I did not make a study to see how of these 6154 bytes much were unneeded 
definitions, how much was meta data, and how much was excessive 
grouping.  But, it should be clear to anyone that if the file can be cut 
in half without any effect on the image that there was junk in the file, 
which was my point.

I also had to rearrange the definitions with a text editor, but this had 
no  significant effect on the file size (actually, it added a few 
bytes).  The fact that I needed to use a text editor would be considered 
to be a bug in InkScape.

While it might be possible to remove the junk from an SVG file without 
removing the desired groupings, it is much easier to simply remove all 
groupings.  It is possible that this is necessary to do this when using 
InkScape to remove the unneeded definitions.  InkScape would not remove 
any unneeded definitions from this file till I ungrouped objects and 
removed unneeded groupings.  This would be considered a bug in InkScape 
so, consider removing all the groups to be a workaround.

IAC, it is my best guess that the desired groupings and the metadata 
would add only a small amount to the file size -- not more than double 
it.  However, I see no need for them in the final SVG file.

-- 
JRT




More information about the kde-core-devel mailing list