
On 18.08.2010 10:40, Jasper van de Gronde wrote:
I'm assuming you are aware of "vacuum defs"? If it fails to work, please file a bug report.
I'm aware of that function, and the defs were only one point in this list. I usually do a clean up in the xml editor.
stroke-linecap, linejoin etc. declarations that only set the default value but clog up the file.
Yes, in general Inkscape needs to take those things into account more, if you have some specific examples we'd love to have a bug report for those. But realize that sometimes there is a fine line, in some cases "optimizing" our SVG may in fact be counterproductive in that it yields modest gains in file size and such but does obscure the SVG.
What mostly bothers me is this behavior: I draw an object, and once I switch the opacity to check with the things that are below it (to do some tracing), and later go back to 100% opacity, inkscape keeps the opacity:1, without needing it. Same is valid for other options. If coordinates are rewritten dynamically between absolute/relative, I assume the other settings could also be reviewed when changes occur, if they are needed or not.
In addition to be able to dynamically switching between relative/absolute coordinates, there should be a possibility to clean up the svg in a way, say loose unneeded declarations, apply transformations where possible, and even lower the precision on some cases/round to some extent.
As I explained paths are currently already optimized by Inkscape (including but not limited to switching between relative/absolute), you're not going to be able to make the path data any smaller than it is right now (except by removing spaces and such, which was deliberately avoided). Is there any other reason for wanting to switch between relative and absolute coordinates?
I did not know yet that inkscape dynamically decides which way is shorter (in memory); if that's the case, then I don't need to switch all by myself.
As for the other things, a lot of that is already possible (Inkscape has two modes for applying transformations and you can set the precision at which it works). Any specific requests for enhancing the functionality are most welcome though.
I currently have the setting to 'optimize transformations'. After some testing, I found that what I'd need has to do with a grouped object (this also applies to the 'resize page size to object', which also produces a transformation:
If I move an object around, the coordinates are adjusted in the XML as expected. If the object is a group, the group gets a 'transform' tag which is only changed subsequently.
The only way to apply the transformation is to ungroup-regroup, which doesn't work on the entire page (after the 'resize page size to object'). Apparently, there's currently no way for doing this.