Superfluous markup

Bug #212077 reported by Martin Andersen
6
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Wishlist
Unassigned

Bug Description

The heading is general, and cover various areas.
EG:
When editing a file with Circle elements, Inkscape adds *seemingly* superfluous Sodipodi attributes to it:
    <circle id="circle3916"
       style="fill:#ff8080;stroke:none"
       transform="translate(0,1710)"
       r="19"
       cy="90"
       cx="45"
       sodipodi:ry="19"
       sodipodi:rx="19"
       sodipodi:cy="90"
       sodipodi:cx="45" />
A circle element has only one radius, as far as I know. There is a separate Ellipse element.
So, why the extra attributes? And can they be safely removed to make a lighter file?

Other issues is bloated Style attributes (see bug#170184) and new in 0.46 Inkscape adding Perspective to everything, irrespective of whether the 3D tool is used. One default I could deal with, but it keeps adding more.
Example of the former:
style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:new"
added to every damn element in a large drawing blows the filesize right out.
First, remove Default values where they don't need to override inherited styles;
Second, remove redundant styles, like Stroke styles when Stroke is none;
style="opacity:1;fill:#000000;stroke:none"
Third, have an option like in Illustrator where you can define stylesheets in the header and reference them for often-used styles, eg if long styles are needed on every element

As a Web standard, size is an issue in SVGs.

Tags: svg
Revision history for this message
Martin Andersen (msandersen) wrote :

Oh, and opacity:1 in the above example is also redundant. The above long style recurs 131 times in one of my drawings. Removing the redundant styles with a search-and-replace shaved 42kb off the file.
It also demonstrates the problem of rounding errors, a separate issue, where setting 0.3 becomes 0.30000001.

nightrow (jb-benoit)
Changed in inkscape:
importance: Undecided → Wishlist
Revision history for this message
Marcin Floryan (mfloryan) wrote :

It would be nice as well if there was an option to vacuum defs on save.

Changed in inkscape:
status: New → Confirmed
Revision history for this message
codedread (codedread) wrote :

There is a python script that now does this sort of thing: http://launchpad.net/scour/

Revision history for this message
jazzynico (jazzynico) wrote :

The circle and ellipse superfluous attributes are removed in the trunk (bug they stays when the object is an arc).
See http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/12670

Changed in inkscape:
status: Confirmed → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.