Commit graph

208 commits

Author SHA1 Message Date
Louis Simard
437dbf991c Fix bug 702423, "Scour corrupts icons with gradients when --disable-style-to-xml is used". Add 2 more full tests gathered from the bug reports, as well as 1 more unit test. 2011-03-12 03:22:03 -05:00
Louis Simard
fcbb2b0332 Apply a patch submitted by Jan Thor for the feature described in bug 492277, "Remove only auto generated id's".
Adds the command-line options --protect-ids-noninkscape, --protect-ids-list and --protect-ids-prefix, and three options to the Inkscape Save as Optimized SVG dialog.
2011-02-21 23:05:52 -05:00
Louis Simard
48776271d7 Fix bug 717826, whereby newlines are output as CR CR LF by Scour on Inkscape/Windows when they should be LF or CR LF. Now they're output as CR LF, and standalone Scour outputs LF. 2011-02-16 12:27:23 -05: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
04d72454c5 Fix bug 708515, whereby file:// URLs would not count as real references for raster image embedding. 2011-02-09 15:44:41 -05:00
Louis Simard
a99b7e27ea Add a new piece of code proposed by Jan Thor in bug 714727 to remove text-based attributes from groups that only have non-text elements as descendants. 2011-02-09 15:04:42 -05:00
Louis Simard
aee0804114 Add 'text-align' to the list of text properties that get removed on non-text elements. Fixes bug 714720. 2011-02-07 14:00:10 -05:00
Louis Simard
da3c9f1d98 Apply a fix by Jan Thor to bug 714717, whereby Scour wrongly optimises away "0-length" Bézier curves if they have non-zero control points that actually create a curve. 2011-02-07 13:48:15 -05:00
Louis Simard
6dc2553bed Apply a fix proposed by Jan Thor in bug 702423, to correct a code error that may be part of a bug whereby non-duplicate gradients are removed when using --disable-style-to-xml. 2011-02-07 13:20:04 -05:00
Louis Simard
cd63079879 Fix bug 638764: Error in rule_ellptical_arc crashes Scour, by applying the fix provided by Walther. 2010-11-14 23:19:51 -05:00
Louis Simard
fee74ead24 Add the option --no-renderer-workaround, which disables renderer workarounds. Made --renderer-workaround the default, to avoid duplicate bugs reported against Scour instead of librsvg.
(The option --renderer-workaround still exists, for compatibility with Scour 0.25, but is now a dummy option.)
2010-10-04 19:19:40 -04:00
Bernd Feige
52e86032fa Future-proof the Scour Inkscape plugin's method of acquiring the name of the file to optimise. Thanks to Bernd Feige for the patch. 2010-08-31 22:10:58 -04:00
Louis Simard
b7277e0877 Properly set the parentNode on created <g> elements and their children for --create-groups, to avoid trouble later on. 2010-08-11 23:25:06 -04:00
Louis Simard
beccc7c577 Abuse "".join(list) some more, to replace string concatenation. On Python 2.6.5, 80% of the time spent serialising the output SVG file is saved with this change. 2010-08-11 23:05:00 -04:00
Louis Simard
f00b1a24f8 Make the --create-groups option run faster.
Make polygon/polyline point parsing faster; make it need less regexp object allocations.
2010-08-11 21:43:37 -04: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
Louis Simard
11a2e71096 Add Johan's Tree of Life as fulltests/tree-of-life.svg
Source: http://github.com/johan/tree-of-life.svg
2010-07-13 18:01:31 -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
3559499321 Add some icons from Ubuntu to fulltests/. They have various rendering changes when Scoured with full optimisation options selected. 2010-07-10 08:09:13 -04: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
2a6cfb6b2c More fixing for the --renderer-workaround option, after testing with files from Ubuntu 10.04. 2010-06-19 05:17:18 -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
bb1a38a7ad (Partial?) fix for bug 594930: In a <switch>, require one level of <g> if there was a <g> in the file already. Otherwise, only the first subelement of the <g> is chosen and rendered. 2010-06-16 02:29:01 -04:00
Cynthia Gauthier
26d90a7529 Fix a bug whereby a polyline's last segment could be removed from an SVG document if it was closing the polyline into a polygon. 2010-06-15 22:20:03 -04:00
Cynthia Gauthier
2d28a5991d Fix bug 576958 "Viewbox option doesn't work when units are set", when renderer workarounds are disabled. 2010-06-15 22:18:11 -04:00
Cynthia Gauthier
f2285145d6 Quick fix for url() replacement in shortenIds: it should be url("#xyz") getting replaced, not url(#"xyz"). 2010-06-15 21:55:38 -04:00
Cynthia Gauthier
fdabe02701 Update push.sh with the new branch location for the trunk. Update package.sh, adding the newly-required file svg_transform.py. 2010-06-15 21:40:08 -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
schiller
00804fb833 Remove escaped angle-brackets from inx file 2010-05-12 15:58:52 -05:00
schiller
27b9683279 Update release notes 2010-05-09 15:48:57 -05:00
schiller
5ad1ba6e8a Fix Issue 562784 2010-05-09 15:36:01 -05:00
schiller
40aa6cd54a Fix Bug 577940 2010-05-09 15:32:21 -05:00
JSCHILL1
5e97247f98 Add logos and statistics spreadsheet 2010-04-25 21:58:03 -05: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
fd82967bbc Add a couple minor tests for the CSS parser 2010-02-07 08:49:38 -06:00
JSCHILL1
7957dcd7c4 Add test script for yocto_css and call it from testscour.py 2010-02-07 08:45:57 -06:00
JSCHILL1
34b06e310a Add test script for yocto_css and call it from testscour.py 2010-02-07 08:44:49 -06:00
JSCHILL1
2275c46569 Final scour 0.24 2010-02-05 16:28:24 -06:00
JSCHILL1
c00bc8b70c Fix bug when DOCTYPE is present. Big performance improvement to makeWellFormed() function 2010-02-05 16:28:13 -06:00
JSCHILL1
c835423e8f Fix Bug 511186: Preserve comments surround <svg> root node 2010-02-04 19:31:54 -06:00
JSCHILL1
6147bb2085 Fix Bug 517064: Make XML well-formed again by properly translating the 5 XML entities 2010-02-04 09:30:22 -06:00
JSCHILL1
6230682a01 Fix Bug 503750: Update inkscape extension to include new --enable-viewboxing option 2010-01-08 22:24:08 -06:00