Scour - An SVG Optimizer / Cleaner
scour.py, scour.inkscape.py, scour.inx: * Add options --quiet, --enable-comment-stripping, --shorten-ids, --remove-metadata, --renderer-workaround. scour.py: * Optimisations in time (so Scour runs faster) and space (so Scour allocates less memory, less often). * Change #E+# to #e#, #E-# to #e-#, 0.# to .# and -0.# into -.# in path/polygon/polyline data + lengths, if renderer workarounds are disabled. Use spaces instead of commas in path/polygon/polyline data. Use lower-case #rrggbb and #rgb instead of upper-case. All of this makes gzip work better, since the rest of SVG documents mostly has lower-case letters in tag names and spaces to separate XML attributes etc. * Fix a bug whereby an SVG document would become filled with black if all elements had the same fill color. * Fix a bug whereby a path's second command would not start at the right coordinates if the first command was a relative moveto 'm' with at least 1 implied lineto. * Fix a bug whereby a path's absolute lineto 'L' commands would not become the right relative lineto 'l' commands. * Allow the implicit linetos after a path's moveto 'M'/'m' to be converted into relative horizontal linetos 'h' and vertical 'v' too. scour.inx: * Fix help typos. Make options more descriptive in the plugin option window. Add something about enable-group-collapsing requiring enable-id-stripping. testscour.py: * Rework tests that relied on #E+#, #E-#, 0.# and -0.# so that they accept the changes to scour.py. Add unit tests for strip-xml-prolog, enable-comment-stripping and remove-metadata. |
||
|---|---|---|
| fulltests | ||
| logos | ||
| python-modules-pre24 | ||
| unittests | ||
| CONTRIBUTORS | ||
| crunch.sh | ||
| LICENSE | ||
| NOTICE | ||
| package.sh | ||
| push.sh | ||
| README.txt | ||
| release-notes.html | ||
| scour.inkscape.py | ||
| scour.inx | ||
| scour.py | ||
| scra.py | ||
| statistics.html | ||
| statistics.xls | ||
| svg_regex.py | ||
| svg_transform.py | ||
| testcss.py | ||
| testscour.py | ||
| webscour.py | ||
| yocto_css.py | ||
Scour ===== Scour is a Python module that takes an input SVG and outputs a cleaner, more concise SVG file. The goal is that authors will use this script after editing the file in a GUI editor such as Inkscape or Adobe Illustrator. Scour was started as a vehicle for me to learn Python. In addition, the goal is to reduce the amount of time I spend in cleaning up files I find on sites such as openclipart.org Ideas are pulled from three places: - my head - Sam Ruby's SVG Tidy script: http://intertwingly.net/code/svgtidy/svgtidy.rb - Inkscape's proposal for a 'cleaned SVG': http://wiki.inkscape.org/wiki/index.php/Save_Cleaned_SVG Regards, Jeff Schiller 2009-04-06 codedread@gmail.com http://blog.codedread.com/