Scour - An SVG Optimizer / Cleaner
Find a file
Cynthia Gauthier f4cca44faf Merge branch lp:~louis-simard/scour/rework. Summary of changes:
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.
2010-06-15 20:58:57 -04:00
fulltests Fix removal of common attributes if parent has non-whitespace text nodes 2009-09-24 09:54:56 -05:00
logos Add logos and statistics spreadsheet 2010-04-25 21:58:03 -05:00
python-modules-pre24 Add Martin's patch for rewrite of command-line option parsing. Add CGI and mod_python versions of a web interface. 2009-05-22 09:04:40 -05:00
unittests Merge branch lp:~louis-simard/scour/rework. Summary of changes: 2010-06-15 20:58:57 -04:00
CONTRIBUTORS Rewrite to use optparse for user interface, picking up a few minor bug fixes and improvements in the process, but trying to keep otherwise unchanged. 2009-05-20 19:22:57 +01:00
crunch.sh Added --enable-viewboxing option and stop setting width/height to 100% by default 2009-12-31 13:59:54 -06:00
LICENSE Move to Apache License 2009-04-06 10:09:23 -05:00
NOTICE Add NOTICE file 2009-04-06 10:14:02 -05:00
package.sh Add test script for yocto_css and call it from testscour.py 2010-02-07 08:44:49 -06:00
push.sh Added GPLv3 License file and push script 2009-04-02 14:13:04 -05:00
README.txt Restore accidentally deleted README file 2009-04-25 02:39:14 -05:00
release-notes.html Update release notes 2010-05-09 15:48:57 -05:00
scour.inkscape.py Merge branch lp:~louis-simard/scour/rework. Summary of changes: 2010-06-15 20:58:57 -04:00
scour.inx Merge branch lp:~louis-simard/scour/rework. Summary of changes: 2010-06-15 20:58:57 -04:00
scour.py Merge branch lp:~louis-simard/scour/rework. Summary of changes: 2010-06-15 20:58:57 -04:00
scra.py Final scour 0.18: more fixes to XML serialization (wellformedness), some unit tests, update to package script to use zip file and to package the inkscape extension 2009-08-09 22:25:20 -05:00
statistics.html Final Scour 0.16 check-in 2009-07-30 00:12:59 -05:00
statistics.xls Add logos and statistics spreadsheet 2010-04-25 21:58:03 -05:00
svg_regex.py Merge branch lp:~louis-simard/scour/rework. Summary of changes: 2010-06-15 20:58:57 -04:00
svg_transform.py Merge branch lp:~louis-simard/scour/rework. Summary of changes: 2010-06-15 20:58:57 -04:00
testcss.py Fix Bug 541889: Properly parse polygon/polyline points missing whitespace/comma for negative attributes 2010-03-25 17:48:15 -07:00
testscour.py Merge branch lp:~louis-simard/scour/rework. Summary of changes: 2010-06-15 20:58:57 -04:00
webscour.py Add Martin's patch for rewrite of command-line option parsing. Add CGI and mod_python versions of a web interface. 2009-05-22 09:04:40 -05:00
yocto_css.py Fix bug with polygon point parsing. Fix bug 368716: tiny CSS parser to find referenced elements in style element 2009-08-31 00:11:34 -05:00

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/