Commit graph

233 commits

Author SHA1 Message Date
JazzyNico
0d31f60b06 Fix the Inkscape module being unable to work on SVG documents that contain embedded images.
scour.inkscape.py: Pass the input file's name.
2012-11-16 18:59:29 -05:00
Louis Simard
58ddeb855b Fix bug 833666, "scour does not clean comments if file starts with a comment", by correctly and efficiently iterating over the elements of a live sequence. Unit tests are updated. 2012-05-03 15:33:11 -04:00
Jeff Schiller
4b10b6d627 Fix nested defs problem and add unit test 2012-03-26 23:33:27 -07:00
Jeff Schiller
ac6d4529bd Remove namespaced attributes. Fix DOM element tagName parsing. Update HTML so that each scoured file links persist. 2011-12-29 22:31:48 -08:00
Jeff Schiller
fbcbedef37 Add a starter JavaScript version of Scour 2011-12-29 16:11:55 -08:00
Hungerburg
60b48353b3 Apply a modified patch by Hungerburg to fix bugs 833666, "scour does not clean comments if file starts with a comment", and bug 804238, whereby Scour fails to correctly parse a polygon/polyline if its first coordinate is negative.
Unit tests added for the negative coordinate parsing.
2011-08-25 22:26:05 -04:00
Louis Simard
f8c88f0dfa Add release notes for version 0.26. 2011-05-11 01:04:10 -04:00
Louis Simard
63690b7c6c CONTRIBUTORS: Fix erroneous contributor name. It's Johan Sundström who contributed the transform matrix patches, not Ubuntu's Jamie Strandboge! 2011-05-10 16:50:16 -04:00
Jeff Schiller
4ae90d75cd Woops, forgot to update the version in the script 2011-05-09 21:54:51 -07:00
Jeff Schiller
b35b74f70d Finalize scour 0.26 2011-05-09 21:47:09 -07:00
Louis Simard
e4f9b00f9c Apply the patch by JazzyNico in bug 748639, "Interface for saving to Optimized SVG too large". 2011-04-21 16:02:34 -04:00
Louis Simard
ce735105d9 Attempt to fix bug 747698, "protect_ids options missing in scour.inkscape.py". 2011-04-01 21:58:08 -04:00
Jeff Schiller
6c50c78d99 Fix Bug 734933: Do not remove empty path segments if stroke-linecap is round 2011-03-15 08:16:16 -07:00
Louis Simard
cd42752cad Merge from lp:~ecmanaut/scour/transform. Optimise negative 3-digit rotation angles to the positive form, and angles over positive 270 to the negative form. Also cath more angles outside of the range [-360, 360]. 2011-03-14 16:56:56 -04:00
Johan Sundström
5987a9a271 Rotate transforms now optimize angles, and have test coverage. 2011-03-12 03:35:13 -08:00
Louis Simard
45bc6c0fac Merge fixes from lp:~scouring/scour/transform, some sourced from lp:~ecmanaut/scour/transform. 2011-03-12 03:56:15 -05:00
Louis Simard
08fc009cba Add a modulo 360 for coalesced rotate() transformation angles. This allows rotate(-300) rotate(-60) from the unit test to be correctly made into rotate(0).
Allow skewX(0), skewY(0) and rotate(0) to be deleted in 1-transformation lists.

All unit tests pass now.
2011-03-12 03:51:04 -05:00
Louis Simard
9e49151ebf Fix a TypeError generated by Math.asin(), which doesn't accept Decimal arguments. 2011-03-12 03:35:33 -05:00
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
ba3371e282 scour.py: Modify optimizeTransform to remove superfluous []s and ()s.
testscour.py: Add unit tests for Johan Sundström's fix for bug 722544, "SVG transform matrix() arg order is a1 b1 a2 b2 a3 b3, not a1 a2 a3 b1 b2 b3".

unittests/: Edit the unit tests' support files not to have a second line with the correct transformation. This is customarily in testscour.py.
2011-02-21 20:51:35 -05:00
Johan Sundström
338e56f1b1 A trig. improvement TODO I left by the wayside; Decimal seems very unhelpful here. :/ 2011-02-21 03:01:05 -08:00
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
66ef44691b Tidied up more of the transform code for readability. 2011-02-21 01:43:58 -08:00
Johan Sundström
c6a9336185 Fixed the transform optimizations, which were all broken (wrong arg order). 2011-02-21 01:13:56 -08:00
Johan Sundström
438fd06952 Add missing trailing newlines to unit test svgs. 2011-02-20 18:13:23 -08: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