Commit graph

82 commits

Author SHA1 Message Date
Johan Sundström
5f18a23fd7 Remove skewX(0) and skewY(0) too. How do they stack? 2011-02-21 02:48:07 -08:00
Johan Sundström
f45173f4ee Some transform test files in need of corresponding test code. 2011-02-21 01:50:33 -08:00
Johan Sundström
438fd06952 Add missing trailing newlines to unit test svgs. 2011-02-20 18:13:23 -08:00
Louis Simard
4657cb7515 Apply a modified patch submitted by Jan Thor in bug 717254 to fix a bug whereby Scour would keep the <defs/> element if it was there but had only whitespace or unreferenced children. 2011-02-11 12:29:20 -05:00
Louis Simard
bdae2bafae Apply the patches submitted by Jan Thor in bug 714731. These patches remove attributes whose value equals its default value per the SVG specification, except if an element's parent node defines a non-default value explicitly, and add unit tests. 2011-02-10 19:48:53 -05:00
Louis Simard
2b68c7ed37 Adjust the unit tests for revision 197/bug 714717 (Optimizing some cubic beziers away). The behavior of the unit test checking for "c<nonzero> <nonzero> <zero>" being removed is now correct again. 2011-02-09 16:11:33 -05:00
Louis Simard
87b7908465 Move Tree_of_Life_SVG.svg (revision 188) from unittests to fulltests. Whoops!
Partial fix for bug 603987: Allow curves representing straight lines to become LineTo commands (and possibly HorizontalLineTo and VerticalLineTo afterwards).

Fix a bug whereby an initial M0,0 in path data is lost, making the path unrenderable.
2010-07-16 22:04:22 -04:00
Louis Simard
939c7e1b97 Add fulltests/Tree_of_life_SVG.svg from Wikipedia, as a large file benchmark in both time and file size.
This file also happens to render incorrectly after Scouring with librsvg.
2010-07-13 18:26:34 -04:00
Jeff Schiller
b68f8483c7 Remove empty m0,0 segments 2010-07-13 09:14:17 -07:00
Jeff Schiller
5f8139a6e3 Add marker-start, marker-mid, marker-end to list of SVG properties that get converted to attributes 2010-07-11 22:48:40 -07:00
Hurr Durr
3fc0877b7c Fix bug 603994, whereby a <style> stylesheet would not count as a reference towards gradients etc., if the stylesheet was a CDATA element surrounded by whitespace nodes.
Add unit tests for this.

Add some descriptions to the failure modes of some unit tests, which would fail without any message (if they failed, but right now they succeed! ;).
2010-07-11 16:16:45 -04:00
Jeff Schiller
c17c689ae4 Fix Bug 604000: Correctly remove overflow attributes on marker, pattern, svg 2010-07-11 11:18:26 -07:00
Jeff Schiller
b661e479ea Fix Bug 603988: do not commonize attributes if element is referenced elsewhere 2010-07-11 08:52:18 -07:00
Cynthia Gauthier
404c013e5f Implement the feature described in bug 598976: Create a <g> with the common attributes of a run of elements if there are 3 or more elements in the run. 2010-07-02 05:35:31 -04:00
Cynthia Gauthier
c3982e28df Add unit tests for requiring a <g> in a <switch> if the original file has one. 2010-06-16 03:49:46 -04:00
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
JSCHILL1
9042bbae31 Fix Bug 519698: Do not collapse move commands together because they may have line segments 2010-03-27 11:41:19 -05:00
JSCHILL1
05e73f11c3 Fix Bug 541889: Properly parse polygon/polyline points missing whitespace/comma for negative attributes 2010-03-25 17:48:15 -07:00
JSCHILL1
c00bc8b70c Fix bug when DOCTYPE is present. Big performance improvement to makeWellFormed() function 2010-02-05 16:28:13 -06:00
JSCHILL1
4198961174 Attempt to handle line endings in a cross-platform manner 2009-11-13 10:44:18 -06:00
JSCHILL1
de6c2eb924 Update release notes, add some misc unit tests I missed 2009-11-09 21:59:32 -06:00
JSCHILL1
7e8d777639 Fix Issue 479669: Handle empty styl elements 2009-11-09 21:27:26 -06:00
JSCHILL1
99dfb0f819 Fix whitespace collapsing when it shouldn't on non-textual elements that have xml:space=preserve 2009-11-06 17:21:57 -06:00
JSCHILL1
20fe836041 Fix Bug 436569: Get xlink:href prefix right in case of duplicate gradient 2009-09-27 19:53:34 -05:00
JSCHILL1
e0aacf646d Fix XML serialization when xml:space=preserve 2009-09-24 10:37:09 -05:00
JSCHILL1
7652fbc76c Fix removal of common attributes if parent has non-whitespace text nodes 2009-09-24 09:54:56 -05:00
JSCHILL1
7fcc125286 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
JSCHILL1
d9e3e2436b Remove unused attributes from parent elements 2009-08-13 08:18:49 -05:00
JSCHILL1
cf5fb8a37d Fix Bug 412754: Elliptical arc commands must have comma or whitespace separating 2009-08-12 23:41:09 -05:00
JSCHILL1
2342830671 Ensure depth-first analysis of common attributes so they bubble up to the top 2009-08-12 14:18:08 -05:00
JSCHILL1
0bf1e8942c Fix bug in remapping of namespace prefixes (was not actually remapping child elements of replaced elements 2009-08-12 10:04:40 -05:00
JSCHILL1
d4747e2bd7 Fix prefixing namespace prefix declarations when not using the default namespace (XML serialization bug) 2009-08-12 09:49:22 -05:00
JSCHILL1
eb2a7a05ac 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
JSCHILL1
5f5c8a431d Fix Bug 411062: typo of 'true'. Modify unit test to cover exercising the code. Update testscour.py for new indent_type option. 2009-08-09 15:04:50 -05:00
JSCHILL1
e17d3b8526 Added unit test for CDATA nodes 2009-08-05 22:53:51 -05:00
JSCHILL1
61a7265ecf Add unit tests to reduce to shorthand curve path segments. Updated test script 2009-08-05 17:05:27 -05:00
JSCHILL1
94a1e28a57 Added inkscape extension files 2009-08-04 14:39:04 -05:00
JSCHILL1
a93c626ab6 Add XML prolog to all unittests 2009-08-03 19:23:57 -05:00
JSCHILL1
c9ecfc05a7 Remove redundant SVG namespace declarations and prefixes 2009-08-03 17:44:40 -05:00
JSCHILL1
6fce13b84f Scour length values for most attributes. Fix removal of duplicate gradients again. Two more unittests 2009-08-03 12:23:41 -05:00
JSCHILL1
3371177b80 Add polyline unittest 2009-08-03 09:21:37 -05:00
JSCHILL1
46f86a0978 Prevent scour from trying to remove a duplicate gradient more than once 2009-08-01 11:59:54 -05:00
JSCHILL1
b119af0499 Added unittest for not converting short color names 2009-08-01 10:53:17 -05:00
Jeff Schiller
9ade298cd6 Also cover quoted forms of url(#grad) for removing duplicate gradients 2009-08-01 10:48:55 -05:00
JSCHILL1
9bec4cc4d0 Only convert color names to #RRGGBB if it will actually be shorter 2009-08-01 07:23:24 -05:00
JSCHILL1
b28ae6ec8d Remove trailing zeros from path coordinates. Use scientific notation in path coords if shorter. Scour polygon coordinates just like path coordinates. Added tests 2009-07-29 12:27:51 -05:00
JSCHILL1
f1f0aab965 Add closepath test 2009-07-05 08:14:40 -05:00
JSCHILL1
e163fb348c Implemented converted straight curves into lines. Remove last point from polygon data if possible 2009-05-21 21:32:44 -05:00
JSCHILL1
56cc8fd15a Collapse consecutive h,v segments/coords where possible 2009-05-19 21:30:50 -05:00
JSCHILL1
49b35bf6d1 Remove text styles from shapes. Remove --inkscape styles. Fix path handling for multiple coords in first Move command. Add --set-precision N argument 2009-05-19 10:02:47 -05:00