Compare commits

..

No commits in common. "master" and "v0.26" have entirely different histories.

158 changed files with 2964 additions and 9136 deletions

View file

@ -1,30 +0,0 @@
sudo: false
language: python
python:
- pypy
- 2.7
- 3.4
- 3.5
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10-dev
install:
- pip install tox-travis codecov
script:
- tox
matrix:
fast_finish: true
include:
- python: 3.9
env:
- TOXENV=flake8
after_success:
- coverage combine && codecov

View file

@ -1,35 +0,0 @@
# Contributing
Contributions to Scour are welcome, feel free to create a pull request!
In order to be able to merge your PR as fast as possible please try to stick to the following guidelines.
> _**TL;DR** (if you now what you're doing) Always run [`make check`](https://github.com/scour-project/scour/blob/master/Makefile) before creating a PR to check for common problems._
## Code Style
The Scour project tries to follow the coding conventions described in [PEP 8 - The Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/). While there are some inconsistencies in existing code (e.g. with respect to naming conventions and the usage of globals), new code should always abide by the standard.
To quickly check for common mistakes you can use [`flake8`](https://pypi.python.org/pypi/flake8). Our [Makefile](https://github.com/scour-project/scour/blob/master/Makefile) has a convenience target with the correct options:
```Makefile
make flake8
```
## Unit Tests
In order to check functionality of Scour and prevent any regressions in existing code a number of tests exist which use the [`unittest`](https://docs.python.org/library/unittest.html) unit testing framework which ships with Python. You can quickly run the tests by using the [Makefile](https://github.com/scour-project/scour/blob/master/Makefile) convenience target:
```Makefile
make test
```
These tests are run automatically on all PRs using [TravisCI](https://travis-ci.org/scour-project/scour) and have to pass at all times! When you add new functionality you should always include suitable tests with your PR (see [`test_scour.py`](https://github.com/scour-project/scour/blob/master/test_scour.py)).
### Coverage
To ensure that all possible code conditions are covered by a test you can use [`coverage`](https://pypi.python.org/pypi/coverage). The [Makefile](https://github.com/scour-project/scour/blob/master/Makefile) convenience target automatically creates an HTML report in `htmlcov/index.html`:
```Makefile
make coverage
```
These reports are also created automatically by our TravisCI builds and are accessible via [Codecov](https://codecov.io/gh/scour-project/scour)

View file

@ -1,347 +0,0 @@
# Release Notes for Scour
## Version 0.38.2 (2020-11-22)
* Fix another regression caused by new feature to merge sibling groups ([#260](https://github.com/scour-project/scour/issues/260))
## Version 0.38.1 (2020-09-02)
* Fix regression caused by new feature to merge sibling groups ([#260](https://github.com/scour-project/scour/issues/260))
## Version 0.38 (2020-08-06)
* Fix issue with dropping xlink:href attribute when collapsing referenced gradients ([#206](https://github.com/scour-project/scour/pull/206))
* Fix issue with dropping ID while de-duplicating gradients ([#207](https://github.com/scour-project/scour/pull/207))
* Improve `--shorten-ids` so it re-maps IDs that are already used in the document if they're shorter ([#187](https://github.com/scour-project/scour/pull/187))
* Fix whitespace handling for SVG 1.2 flowed text ([#235](https://github.com/scour-project/scour/issues/235))
* Improvement: Merge sibling `<g>` nodes with identical attributes ([#208](https://github.com/scour-project/scour/pull/208))
* Improve performance of XML serialization ([#247](https://github.com/scour-project/scour/pull/247))
* Improve performance of gradient de-duplication ([#248](https://github.com/scour-project/scour/pull/248))
* Some general performance improvements ([#249](https://github.com/scour-project/scour/pull/249))
## Version 0.37 (2018-07-04)
* Fix escaping of quotes in attribute values. ([#152](https://github.com/scour-project/scour/pull/152))
* A lot of performance improvements making processing significantly faster in many cases. ([#167](https://github.com/scour-project/scour/pull/167), [#169](https://github.com/scour-project/scour/pull/169), [#171](https://github.com/scour-project/scour/pull/171), [#185](https://github.com/scour-project/scour/pull/185))
* Fix exception when removing duplicated gradients while `--keep-unreferenced-defs` is used ([#173](https://github.com/scour-project/scour/pull/173))
* Remove some illegal optimizations of `m0 0` sub-path commands ([#178](https://github.com/scour-project/scour/pull/178))
* Fix and improve handling of boolean flags in elliptical arc path commands ([#183](https://github.com/scour-project/scour/pull/183))
* Fix exception when shorthand transform `scale(1)` with single number is used ([#191](https://github.com/scour-project/scour/pull/191))
* Fix exception when using two-number forms of the filter attributes `baseFrequency`, `order`, `radius` and `stdDeviation` ([#192](https://github.com/scour-project/scour/pull/192))
* Improve whitespace handling in text nodes fixing an issue where scouring added spaces in error and reducing file size in many cases ([#199](https://github.com/scour-project/scour/pull/199))
* Drop official support for Python 3.3. (While it will probably continue to work for a while compatibility is not guaranteed anymore. If you continue to use Scour with Python 3.3 and should find/fix any compatibility issues pull requests are welcome, though.)
## Version 0.36 (2017-08-06)
* Fix embedding of raster images which was broken in most cases and did not work at all in Python 3. ([#120](https://github.com/scour-project/scour/issues/120))
* Some minor fixes for statistics output.
* Greatly improve the algorithm to reduce numeric precision.
* Precision was not properly reduced for some numbers.
* Only use reduced precision if it results in a shorter string representation, otherwise preserve full precision in output (e.g. use "123" instead of "1e2" when precision is set to 1).
* Reduce precision of lengths in `viewBox` ([#127](https://github.com/scour-project/scour/issues/127))
* Add option `--set-c-precision` which allows to set a reduced numeric precision for control points.<br/>Control points determine how a path is bent in between two nodes and are less sensitive to a reduced precision than the position coordinates of the nodes themselves. This option can be used to save a few additional bytes without affecting visual appearance negatively.
* Fix: Unnecessary whitespace was not stripped from elliptical paths. ([#89](https://github.com/scour-project/scour/issues/89))
* Improve and fix functionality to collapse straight paths segments. ([#146](https://github.com/scour-project/scour/issues/146))
* Collapse subpaths of moveto `m` and lineto `l`commands if they have the same direction (before we only collapsed horizontal/vertical `h`/`v` lineto commands).
* Attempt to collapse lineto `l` commands into a preceding moveto `m` command (these are then called "implicit lineto commands")
* Do not collapse straight path segments in paths that have intermediate markers. ([#145](https://github.com/scour-project/scour/issues/145))
* Preserve empty path segments if they have `stroke-linecap` set to `round` or `square`. They render no visible line but a tiny dot or square.
## Version 0.35 (2016-09-14)
* Drop official support for Python 2.6. (While it will probably continue to work for a while compatibility is not guaranteed anymore. If you continue to use Scour with Python 2.6 and should find/fix any compatibility issues pull requests are welcome, though.)
* Fix: Unused IDs were not shortened when `--shorten-ids` was used. ([#19](https://github.com/scour-project/scour/issues/62))
* Fix: Most elements were still removed from `<defs>` when `--keep-unreferenced-defs` was used. ([#62](https://github.com/scour-project/scour/issues/62))
* Improve escaping of single/double quotes ('/") in attributes. ([#64](https://github.com/scour-project/scour/issues/64))
* Print usage information if no input file was specified (and no data is available from `stdin`). ([#65](https://github.com/scour-project/scour/issues/65))
* Redirect informational output to `stderr` when SVG is output to `stdout`. ([#67](https://github.com/scour-project/scour/issues/67))
* Allow elements to be found via `Document.getElementById()` in the minidom document returned by scourXmlFile(). ([#68](https://github.com/scour-project/scour/issues/68))
* Improve code to remove default attribute values and add a lot of new default values. ([#70](https://github.com/scour-project/scour/issues/70))
* Fix: Only attempt to group elements that the content model allows to be children of a `<g>` when `--create-groups` is specified. ([#98](https://github.com/scour-project/scour/issues/98))
* Fix: Update list of SVG presentation attributes allowing more styles to be converted to attributes and remove two entries (`line-height` and `visibility`) that were actually invalid. ([#99](https://github.com/scour-project/scour/issues/99))
* Add three options that work analogous to `--remove-metadata` (removes `<metadata>` elements) ([#102](https://github.com/scour-project/scour/issues/102))
* `--remove-titles` (removes `<title>` elements)
* `--remove-descriptions` (removes `<desc>` elements)
* `--remove-descriptive-elements` (removes all of the descriptive elements, i.e. `<title>`, `<desc>` and `<metadata>`)
* Fix removal rules for the `overflow` attribute. ([#104](https://github.com/scour-project/scour/issues/104))
* Improvement: Automatically order all attributes ([#105](https://github.com/scour-project/scour/issues/105)), as well as `style` declarations ([#107](https://github.com/scour-project/scour/issues/107)) allowing for a constant output across multiple runs of Scour. Before order could change arbitrarily.
* Improve path scouring. ([#108](https://github.com/scour-project/scour/issues/108))<br>Notably Scour performs all calculations with enhanced precision now, guaranteeing maximum accuracy when optimizing path data. Numerical precision is reduced as a last step of the optimization according to the `--precision` option.
* Fix replacement of removed duplicate gradients if the `fill`/`stroke` properties contained a fallback. ([#109](https://github.com/scour-project/scour/issues/109))
* Fix conversion of cubic Bézier "curveto" commands into "shorthand/smooth curveto" commands. ([#110](https://github.com/scour-project/scour/issues/110))
* Fix some issues due to removal of properties without considering inheritance rules. ([#111](https://github.com/scour-project/scour/issues/111))
## Version 0.34 (2016-07-25)
* Add a function to sanitize an arbitrary Python object containing options for Scour as attributes (usage: `Scour.sanitizeOptions(options)`).<br>This simplifies usage of the Scour module by other scripts while avoiding any compatibility issues that might arise when options are added/removed/renamed in Scour. ([#44](https://github.com/scour-project/scour/issues/44))
* Input/output file can now be specified as positional arguments (e.g. `scour input.svg output.svg`). ([#46](https://github.com/scour-project/scour/issues/46))
* Improve `--help` output by intuitively arranging options in groups. ([#46](https://github.com/scour-project/scour/issues/46))
* Add option `--error-on-flowtext` to raise an exception whenever a non-standard `<flowText>` element is found (which is only supported in Inkscape). If this option is not specified a warning will be shown. ([#53](https://github.com/scour-project/scour/issues/53))
* Automate tests with continuous integration via Travis. ([#52](https://github.com/scour-project/scour/issues/52))
## Version 0.33 (2016-01-29)
* Add support for removal of editor data of Sketch. ([#37](https://github.com/scour-project/scour/issues/37))
* Add option `--verbose` (or `-v`) to show detailed statistics after running Scour. By default only a single line containing the most important information is output now.
## Version 0.32 (2015-12-10)
* Add functionality to remove unused XML namespace declarations from the `<svg>` root element. ([#14](https://github.com/scour-project/scour/issues/14))
* Restore unittests which were lost during move to GitHub. ([#24](https://github.com/scour-project/scour/issues/24))
* Fix a potential regex matching issue in `points` attribute of `<polygon>` and `<polyline>` elements. ([#24](https://github.com/scour-project/scour/issues/24))
* Fix a crash with `points` attribute of `<polygon>` and `<polyline>` starting with a negative number. ([#24](https://github.com/scour-project/scour/issues/24))
* Fix encoding issues when input file contained unicode characters. ([#27](https://github.com/scour-project/scour/issues/27))
* Fix encoding issues when using `stding`/`stdout` as input/output. ([#27](https://github.com/scour-project/scour/issues/27))
* Fix removal of comments. If a node contained multiple comments usually not all of them were removed. ([#28](https://github.com/scour-project/scour/issues/28))
## Version 0.31 (2015-11-16)
* Ensure Python 3 compatibility. ([#8](https://github.com/scour-project/scour/issues/8))
* Add option `--nindent` to set the number of spaces/tabs used for indentation (defaults to 1). ([#13](https://github.com/scour-project/scour/issues/13))
* Add option `--no-line-breaks` to suppress output of line breaks and indentation altogether. ([#13](https://github.com/scour-project/scour/issues/13))
* Add option `--strip-xml-space` which removes the specification of `xml:space="preserve"` on the `<svg>` root element which would otherwise disallow Scour to make any whitespace changes in output. ([#13](https://github.com/scour-project/scour/issues/13))
## Version 0.30 (2014-08-05)
* Fix ignoring of additional args when invoked from scons.
## Version 0.29 (2014-07-26)
* Add option `--keep-unreferenced-defs` to preserve elements in `<defs>` that are not referenced and would be removed otherwise. ([#2](https://github.com/scour-project/scour/issues/2))
* Add option to ignore unknown cmd line opts.
## Version 0.28 (2014-01-12)
* Add option `--shorten-ids-prefix` which allows to add a custom prefix to all shortened IDs. ([#1](https://github.com/scour-project/scour/issues/1))
## Version 0.27 (2013-10-26)
* Allow direct calling of the Scour module.
## Version 0.26 (2013-10-22)
* Re-release of Scour 0.26, re-packaged as a Python module [available from PyPI](https://pypi.python.org/pypi/scour) (Thanks to [Tobias Oberstet](https://github.com/oberstet)!).
* Development moved to GitHub (https://github.com/scour-project/scour).
## Version 0.26 (2011-05-09)
* Fix [Bug 702423](https://bugs.launchpad.net/scour/+bug/702423) to function well in the presence of multiple identical gradients and `--disable-style-to-xml`.
* Fix [Bug 722544](https://bugs.launchpad.net/scour/+bug/722544) to properly optimize transformation matrices. Also optimize more things away in transformation specifications. (Thanks to Johan Sundstr&ouml;m for the patch.)
* Fix [Bug 616150](https://bugs.launchpad.net/scour/+bug/616150) to run faster using the `--create-groups` option.
* Fix [Bug 708515](https://bugs.launchpad.net/scour/+bug/562784) to handle raster embedding better in the presence of file:// URLs.
* Fix [Bug 714717](https://bugs.launchpad.net/scour/+bug/714717) to avoid deleting renderable CurveTo commands in paths, which happen to end where they started.
* Per [Bug 714727](https://bugs.launchpad.net/scour/+bug/714727) and [Bug 714720](https://bugs.launchpad.net/scour/+bug/714720), Scour now deletes text attributes, including "text-align", from elements and groups of elements that only contain shapes. (Thanks to Jan Thor for the patches.)
* Per [Bug 714731](https://bugs.launchpad.net/scour/+bug/714731), remove the default value of more SVG attributes. (Thanks to Jan Thor for the patch.)
* Fix [Bug 717826](https://bugs.launchpad.net/scour/+bug/717826) to emit the correct line terminator (CR LF) in optimized SVG content on the version of Scour used in Inkscape on Windows.
* Fix [Bug 734933](https://bugs.launchpad.net/scour/+bug/734933) to avoid deleting renderable LineTo commands in paths, which happen to end where they started, if their stroke-linecap property has the value "round".
* Fix [Bug 717254](https://bugs.launchpad.net/scour/+bug/717254) to delete `<defs>` elements that become empty after unreferenced element removal. (Thanks to Jan Thor for the patch.)
* Fix [Bug 627372](https://bugs.launchpad.net/scour/+bug/627372) to future-proof the parameter passing between Scour and Inkscape. (Thanks to Bernd Feige for the patch.)
* Fix [Bug 638764](https://bugs.launchpad.net/scour/+bug/638764), which crashed Scour due to [Python Issue 2531](http://bugs.python.org/issue2531) regarding floating-point handling in ArcTo path commands. (Thanks to [Walther](https://launchpad.net/~walther-md) for investigating this bug.)
* Per [Bug 654759](https://bugs.launchpad.net/scour/+bug/654759), enable librsvg workarounds by default in Scour.
* Added ID change and removal protection options per [bug 492277](https://bugs.launchpad.net/scour/+bug/492277): `--protect-ids-noninkscape`, `--protect-ids-prefix`, `--protect-ids-list`. (Thanks to Jan Thor for this patch.)
## Version 0.25 (2010-07-11)
* Fix [Bug 541889](https://bugs.launchpad.net/scour/+bug/541889) to parse polygon/polyline points missing whitespace/comma separating a negative value. Always output points attributes as comma-separated.
* Fix [Bug 519698](https://bugs.launchpad.net/scour/+bug/519698) to properly parse move commands that have line segments.
* Fix [Bug 577940](https://bugs.launchpad.net/scour/+bug/577940) to include stroke-dasharray into list of style properties turned into XML attributes.
* Fix [Bug 562784](https://bugs.launchpad.net/scour/+bug/562784), typo in Inkscape description
* Fix [Bug 603988](https://bugs.launchpad.net/scour/+bug/603988), do not commonize attributes if the element is referenced elsewhere.
* Fix [Bug 604000](https://bugs.launchpad.net/scour/+bug/604000), correctly remove default overflow attributes.
* Fix [Bug 603994](https://bugs.launchpad.net/scour/+bug/603994), fix parsing of `<style>` element contents when a CDATA is present
* Fix [Bug 583758](https://bugs.launchpad.net/scour/+bug/583758), added a bit to the Inkscape help text saying that groups aren't collapsed if IDs are also not stripped.
* Fix [Bug 583458](https://bugs.launchpad.net/scour/+bug/583458), another typo in the Inkscape help tab.
* Fix [Bug 594930](https://bugs.launchpad.net/scour/+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.
* Fix [Bug 576958](https://bugs.launchpad.net/scour/+bug/576958), "Viewbox option doesn't work when units are set", when renderer workarounds are disabled.
* Added many options: `--remove-metadata`, `--quiet`, `--enable-comment-stripping`, `--shorten-ids`, `--renderer-workaround`.
## Version 0.24 (2010-02-05)
* Fix [Bug 517064](https://bugs.launchpad.net/scour/+bug/517064) to make XML well-formed again
* Fix [Bug 503750](https://bugs.launchpad.net/scour/+bug/503750) fix Inkscape extension to correctly pass `--enable-viewboxing`
* Fix [Bug 511186](https://bugs.launchpad.net/scour/+bug/511186) to allow comments outside of the root `<svg>` node
## Version 0.23 (2010-01-04)
* Fix [Bug 482215](https://bugs.launchpad.net/scour/+bug/482215) by using os.linesep to end lines
* Fix unittests to run properly in Windows
* Removed default scaling of image to 100%/100% and creating a viewBox. Added `--enable-viewboxing` option to explicitly turn that on
* Fix [Bug 503034](https://bugs.launchpad.net/scour/+bug/503034) by only removing children of a group if the group itself has not been referenced anywhere else in the file
## Version 0.22 (2009-11-09)
* Fix [Bug 449803](https://bugs.launchpad.net/scour/+bug/449803) by ensuring input and output filenames differ.
* Fix [Bug 453737](https://bugs.launchpad.net/scour/+bug/453737) by updated Inkscape's scour extension with a UI
* Fix whitespace collapsing on non-textual elements that had xml:space="preserve"
* Fix [Bug 479669](https://bugs.launchpad.net/scour/+bug/479669) to handle empty `<style>` elements.
## Version 0.21 (2009-09-27)
* Fix [Bug 427309](https://bugs.launchpad.net/scour/+bug/427309) by updated Scour inkscape extension file to include yocto_css.py
* Fix [Bug 435689](https://bugs.launchpad.net/scour/+bug/435689) by properly preserving whitespace in XML serialization
* Fix [Bug 436569](https://bugs.launchpad.net/scour/+bug/436569) by getting `xlink:href` prefix correct with invalid SVG
## Version 0.20 (2009-08-31)
* Fix [Bug 368716](https://bugs.launchpad.net/scour/+bug/368716) by implementing a really tiny CSS parser to find out if any style element have rules referencing gradients, filters, etc
* Remove unused attributes from parent elements
* Fix a bug with polygon/polyline point parsing if there was whitespace at the end
## Version 0.19 (2009-08-13)
* Fix XML serialization bug: `xmlns:XXX` prefixes not preserved when not in default namespace
* Fix XML serialization bug: remapping to default namespace was not actually removing the old prefix
* Move common attributes to ancestor elements
* Fix [Bug 412754](https://bugs.launchpad.net/scour/+bug/401628): Elliptical arc commands must have comma/whitespace separating the coordinates
* Scour lengths for svg x,y,width,height,*opacity,stroke-width,stroke-miterlimit
## Version 0.18 (2009-08-09)
* Remove attributes of gradients if they contain default values
* Reduce bezier/quadratic (c/q) segments to their shorthand equivalents (s/t)
* Move to a custom XML serialization such that `id`/`xml:id` is printed first (Thanks to Richard Hutch for the suggestion)
* Added `--indent` option to specify indentation type (default='space', other options: 'none', 'tab')
## Version 0.17 (2009-08-03)
* Only convert to #RRGGBB format if the color name will actually be shorter
* Remove duplicate gradients
* Remove empty q,a path segments
* Scour polyline coordinates just like path/polygon
* Scour lengths from most attributes
* Remove redundant SVG namespace declarations and prefixes
## Version 0.16 (2009-07-30)
* Fix [Bug 401628](https://bugs.launchpad.net/scour/+bug/401628): Keep namespace declarations when using `--keep-editor-data` (Thanks YoNoSoyTu!)
* Remove trailing zeros after decimal places for all path coordinates
* Use scientific notation in path coordinates if that representation is shorter
* Scour polygon coordinates just like path coordinates
* Add XML prolog to scour output to ensure valid XML, added `--strip-xml-prolog` option
## Version 0.15 (2009-07-05)
* added `--keep-editor-data` command-line option
* Fix [Bug 395645](https://bugs.launchpad.net/scour/+bug/395645): Keep all identified children inside a defs (Thanks Frederik!)
* Fix [Bug 395647](https://bugs.launchpad.net/scour/+bug/395647): Do not remove closepath (Z) path segments
## Version 0.14 (2009-06-10)
* Collapse adjacent commands of the same type
* Convert straight curves into line commands
* Eliminate last segment in a polygon
* Rework command-line argument parsing
* Fix bug in embedRasters() caused by new command-line parsing
* added `--disable-embed-rasters` command-line option
## Version 0.13 (2009-05-19)
* properly deal with `fill="url(&quot;#foo&quot;)"`
* properly handle paths with more than 1 pair of coordinates in the first Move command
* remove font/text styles from shape elements (font-weight, font-size, line-height, etc)
* remove -inkscape-font-specification styles
* added `--set-precision` argument to set the number of significant digits (defaults to 5 now)
* collapse consecutive h,v coords/segments that go in the same direction
## Version 0.12 (2009-05-17)
* upgraded enthought's path parser to handle scientific notation in path coordinates
* convert colors to #RRGGBB format
* added option to disable color conversion
## Version 0.11 (2009-04-28)
* convert gradient stop offsets from percentages to float
* convert gradient stop offsets to integers if possible (0 or 1)
* fix bug in line-to-hv conversion
* handle non-ASCII characters (Unicode)
* remove empty line or curve segments from path
* added option to prevent style-to-xml conversion
* handle compressed svg (svgz) on the input and output
* added total time taken to the report
* Removed XML pretty printing because of [this problem](http://ronrothman.com/public/leftbraned/xml-dom-minidom-toprettyxml-and-silly-whitespace/).
## Version 0.10 (2009-04-27)
* Remove path with empty d attributes
* Sanitize path data (remove unnecessary whitespace)
* Convert from absolute to relative path data
* Remove trailing zeroes from path data
* Limit to no more than 6 digits of precision
* Remove empty line segments
* Convert lines to horiz/vertical line segments where possible
* Remove some more default styles (`display:none`, `visibility:visible`, `overflow:visible`,
`marker:none`)
## Version 0.09 (2009-04-25)
* Fix bug when removing stroke styles
* Remove gradients that are only referenced by one other gradient
* Added option to prevent group collapsing
* Prevent groups with title/desc children from being collapsed
* Remove stroke="none"
## Version 0.08 (2009-04-22)
* Remove unnecessary nested `<g>` elements
* Remove duplicate gradient stops (same offset, stop-color, stop-opacity)
* Always keep fonts inside `<defs>`, always keep ids on fonts
* made ID stripping optional (disabled by default)
## Version 0.07 (2009-04-15)
* moved all functionality into a module level function named 'scour' and began adding unit tests
* prevent metadata from being removed if they contain only text nodes
* Remove unreferenced pattern and gradient elements outside of defs
* Removal of extra whitespace, pretty printing of XML
## Version 0.06 (2009-04-13)
* Prevent error when stroke-width property value has a unit
* Convert width/height into a viewBox where possible
* Convert all referenced rasters into base64 encoded URLs if the files can be found
## Version 0.05 (2009-04-07)
* Removes unreferenced elements in a `<defs>`
* Removes all inkscape, sodipodi, adobe elements
* Removes all inkscape, sodipodi, adobe attributes
* Remove all unused namespace declarations on the document element
* Removes any empty `<defs>`, `<metadata>`, or `<g>` elements
* Style fix-ups:
* Fixes any style properties like this: `style="fill: url(#linearGradient1000) rgb(0, 0, 0);"`
* Removes any style property of: `opacity: 1;`
* Removes any stroke properties when `stroke=none` or `stroke-opacity=0` or `stroke-width=0`
* Removes any fill properties when `fill=none` or `fill-opacity=0`
* Removes all fill/stroke properties when `opacity=0`
* Removes any `stop-opacity: 1`
* Removes any `fill-opacity: 1`
* Removes any `stroke-opacity: 1`
* Convert style properties into SVG attributes

View file

@ -1,39 +1,15 @@
all: clean install all: clean install
install: install:
python3 setup.py install python setup.py install
clean: clean:
rm -rf build rm -rf build
rm -rf dist rm -rf dist
rm -rf scour.egg-info rm -rf scour.egg-info
rm -rf .tox
rm -f .coverage*
rm -rf htmlcov
find . -name "*.pyc" -type f -exec rm -f {} \;
find . -name "*__pycache__" -type d -prune -exec rm -rf {} \;
publish: clean publish: clean
python3 setup.py register python setup.py register
python3 setup.py sdist upload python setup.py sdist upload
python setup.py bdist_egg upload
check: test flake8 python setup.py bdist_wininst upload
test:
python3 test_scour.py
test_version:
PYTHONPATH=. python3 -m scour.scour --version
test_help:
PYTHONPATH=. python3 -m scour.scour --help
flake8:
flake8 --max-line-length=119
coverage:
coverage run --source=scour test_scour.py
coverage html
coverage report

View file

@ -1,72 +1,52 @@
# Scour # Scour
[![PyPI](https://img.shields.io/pypi/v/scour.svg)](https://pypi.python.org/pypi/scour "Package listing on PyPI") 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
[![Build status](https://img.shields.io/travis/scour-project/scour.svg)](https://travis-ci.org/scour-project/scour "Build status (via TravisCI)") editing the file in a GUI editor such as Inkscape or Adobe Illustrator.
[![Codecov](https://img.shields.io/codecov/c/github/scour-project/scour.svg)](https://codecov.io/gh/scour-project/scour "Code coverage (via Codecov)")
--- 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
Scour is an SVG optimizer/cleaner written in Python that reduces the size of scalable vector graphics by optimizing structure and removing unnecessary data. Ideas are pulled from three places:
It can be used to create streamlined vector graphics suitable for web deployment, publishing/sharing or further processing. * 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
The goal of Scour is to output a file that renders identically at a fraction of the size by removing a lot of redundant information created by most SVG editors. Optimization options are typically lossless but can be tweaked for more aggressive cleaning. Regards,
Scour is open-source and licensed under [Apache License 2.0](https://github.com/codedread/scour/blob/master/LICENSE). Jeff Schiller, 2009-04-06
Scour was originally developed by Jeff "codedread" Schiller and Louis Simard in in 2010. codedread@gmail.com
The project moved to GitLab in 2013 an is now maintained by Tobias "oberstet" Oberstein and Patrick "Ede_123" Storz.
This fork was created by Alexander Olsson ([alex@aleon.se](mailto:alex@aleon.se?subject=Scour)) at Aleon Apps. http://blog.codedread.com/
## Installation http://www.codedread.com/scour/
Scour requires [Python](https://www.python.org) 2.7 or 3.4+. Further, for installation, [pip](https://pip.pypa.io) should be used.
To install this fork:
```console
sudo make
```
## Extension
Place the modified extension files in the Inkscape extension directory
```console
sudo cp extension/* /usr/share/inkscape/extensions/
```
## Usage ## Usage
Standard: Standard:
```console scour -i mysvg.svg -o mysvg_opt.svg
scour -i input.svg -o output.svg
```
Better (for older versions of Internet Explorer): Better (this works in IE which needs Viewbox):
```console scour -i mysvg.svg -o mysvg_opt.svg --enable-viewboxing
scour -i input.svg -o output.svg --enable-viewboxing
```
Maximum scrubbing: Maximum:
```console scour -i mysvg.svg -o mysvg_opt.svg --enable-viewboxing --enable-id-stripping \
scour -i input.svg -o output.svg --enable-viewboxing --enable-id-stripping \ --enable-comment-stripping --shorten-ids --indent=none
--enable-comment-stripping --shorten-ids --indent=none
```
Maximum scrubbing and a compressed SVGZ file: Maximum + Compress:
```console scour -i mysvg.svg -o mysvg_opt.svgz --enable-viewboxing --enable-id-stripping \
scour -i input.svg -o output.svgz --enable-viewboxing --enable-id-stripping \ --enable-comment-stripping --shorten-ids --indent=none
--enable-comment-stripping --shorten-ids --indent=none
```
Remove scientific notation from path data: ## Notes
```console Packaging from [sources](http://www.codedread.com/scour/) retrieved on 2013/20/22:
scour -i input.svg -o output.svgz --nonsci-output
```
* done by Tavendo GmbH, Tobias Oberstein
* license same as upstream (Apache 2.0)

View file

@ -1,132 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<name>Optimized SVG Output</name>
<id>org.inkscape.output.scour_inkscape</id>
<param name="tab" type="notebook">
<page name="Options" gui-text="Options">
<param gui-text="Number of significant digits for coordinates:"
gui-description="Specifies the number of significant digits that should be output for coordinates. Note that significant digits are *not* the number of decimals but the overall number of digits in the output. For example if a value of &quot;3&quot; is specified, the coordinate 3.14159 is output as 3.14 while the coordinate 123.675 is output as 124."
name="set-precision" type="int" min="1">5</param>
<spacer/>
<param gui-text="Shorten color values"
gui-description="Convert all color specifications to #RRGGBB (or #RGB where applicable) format."
name="simplify-colors" type="bool">true</param>
<param gui-text="Convert CSS attributes to XML attributes"
gui-description="Convert styles from style tags and inline style=&quot;&quot; declarations into XML attributes."
name="style-to-xml" type="bool">true</param>
<spacer/>
<param gui-text="Collapse groups"
gui-description="Remove useless groups, promoting their contents up one level. Requires &quot;Remove unused IDs&quot; to be set."
name="group-collapsing" type="bool">true</param>
<param gui-text="Create groups for similar attributes"
gui-description="Create groups for runs of elements having at least one attribute in common (e.g. fill-color, stroke-opacity, ...)."
name="create-groups" type="bool">true</param>
<spacer/>
<param gui-text="Keep editor data"
gui-description="Don't remove editor-specific elements and attributes. Currently supported: Inkscape, Sodipodi and Adobe Illustrator."
name="keep-editor-data" type="bool">false</param>
<param gui-text="Remove scientific notation"
gui-description="Remove scientific notation from path data."
name="nonsci-output" type="bool">false</param>
<param gui-text="Keep unreferenced definitions"
gui-description="Keep element definitions that are not currently used in the SVG"
name="keep-unreferenced-defs" type="bool">false</param>
<spacer/>
<param gui-text="Work around renderer bugs"
gui-description="Works around some common renderer bugs (mainly libRSVG) at the cost of a slightly larger SVG file."
name="renderer-workaround" type="bool">true</param>
</page>
<page name="Output" gui-text="SVG Output">
<label appearance="header">Document options</label>
<param gui-text="Remove the XML declaration"
gui-description="Removes the XML declaration (which is optional but should be provided, especially if special characters are used in the document) from the file header."
name="strip-xml-prolog" type="bool">false</param>
<param gui-text="Remove metadata"
gui-description="Remove metadata tags along with all the contained information, which may include license and author information, alternate versions for non-SVG-enabled browsers, etc."
name="remove-metadata" type="bool">false</param>
<param gui-text="Remove comments"
gui-description="Remove all XML comments from output."
name="enable-comment-stripping" type="bool">false</param>
<param gui-text="Embed raster images"
gui-description="Resolve external references to raster images and embed them as Base64-encoded data URLs."
name="embed-rasters" type="bool">true</param>
<param gui-text="Enable viewboxing"
gui-description="Set page size to 100%/100% (full width and height of the display area) and introduce a viewBox specifying the drawings dimensions."
name="enable-viewboxing" type="bool">false</param>
<spacer/>
<label appearance="header">Pretty-printing</label>
<param gui-text="Format output with line-breaks and indentation"
gui-description="Produce nicely formatted output including line-breaks. If you do not intend to hand-edit the SVG file you can disable this option to bring down the file size even more at the cost of clarity."
name="line-breaks" type="bool">true</param>
<param gui-text="Indentation characters:"
gui-description="The type of indentation used for each level of nesting in the output. Specify &quot;None&quot; to disable indentation. This option has no effect if &quot;Format output with line-breaks and indentation&quot; is disabled."
name="indent" type="optiongroup" appearance="combo">
<option value="space">Space</option>
<option value="tab">Tab</option>
<option context="Indent" value="none">None</option>
</param>
<param gui-text="Depth of indentation:"
gui-description="The depth of the chosen type of indentation. E.g. if you choose &quot;2&quot; every nesting level in the output will be indented by two additional spaces/tabs."
name="nindent" type="int">1</param>
<param gui-text="Strip the &quot;xml:space&quot; attribute from the root SVG element"
gui-description="This is useful if the input file specifies &quot;xml:space='preserve'&quot; in the root SVG element which instructs the SVG editor not to change whitespace in the document at all (and therefore overrides the options above)."
name="strip-xml-space" type="bool">false</param>
</page>
<page name="IDs" gui-text="IDs">
<param gui-text="Remove unused IDs"
gui-description="Remove all unreferenced IDs from elements. Those are not needed for rendering."
name="enable-id-stripping" type="bool">true</param>
<spacer/>
<param gui-text="Shorten IDs"
gui-description="Minimize the length of IDs using only lowercase letters, assigning the shortest values to the most-referenced elements. For instance, &quot;linearGradient5621&quot; will become &quot;a&quot; if it is the most used element."
name="shorten-ids" type="bool">false</param>
<param gui-text="Prefix shortened IDs with:"
gui-description="Prepend shortened IDs with the specified prefix."
name="shorten-ids-prefix" type="string"></param>
<spacer/>
<param gui-text="Preserve manually created IDs not ending with digits"
gui-description="Descriptive IDs which were manually created to reference or label specific elements or groups (e.g. #arrowStart, #arrowEnd or #textLabels) will be preserved while numbered IDs (as they are generated by most SVG editors including Inkscape) will be removed/shortened."
name="protect-ids-noninkscape" type="bool">true</param>
<param gui-text="Preserve the following IDs:"
gui-description="A comma-separated list of IDs that are to be preserved."
name="protect-ids-list" type="string"></param>
<param gui-text="Preserve IDs starting with:"
gui-description="Preserve all IDs that start with the specified prefix (e.g. specify &quot;flag&quot; to preserve &quot;flag-mx&quot;, &quot;flag-pt&quot;, etc.)."
name="protect-ids-prefix" type="string"></param>
</page>
<page name="About" gui-text="About">
<hbox>
<image>output_scour.svg</image>
<spacer/>
<vbox>
<spacer/>
<label>Optimized SVG Output is provided by</label>
<label appearance="header" indent="1">Scour - An SVG Scrubber</label>
<spacer/>
<label>For details please refer to</label>
<label appearance="url" indent="1">https://github.com/scour-project/scour</label>
</vbox>
</hbox>
<spacer size="expand"/>
<hbox>
<label>This version of the extension is designed for</label>
<label>Scour 0.31+</label>
</hbox>
<param name="scour-version" type="string" gui-hidden="true">0.31</param> <!-- this parameter is checked programmatically in the extension to show a warning -->
<param gui-text="Show warnings for older versions of Scour"
name="scour-version-warn-old" type="bool">true</param>
</page>
</param>
<output>
<extension>.svg</extension>
<mimetype>image/svg+xml</mimetype>
<filetypename>Optimized SVG (*.svg)</filetypename>
<filetypetooltip>Scalable Vector Graphics</filetypetooltip>
</output>
<script>
<command location="inx" interpreter="python">output_scour.py</command>
</script>
</inkscape-extension>

View file

@ -1,100 +0,0 @@
#!/usr/bin/env python
"""
Run the scour module on the svg output.
"""
import inkex
from inkex.localization import inkex_gettext as _
try:
from packaging.version import Version
except ImportError:
raise inkex.DependencyError(
_(
"""Failed to import module 'packaging'.
Please make sure it is installed (e.g. using 'pip install packaging'
or 'sudo apt-get install python3-packaging') and try again.
"""
)
)
try:
import scour
from scour.scour import scourString
except ImportError:
raise inkex.DependencyError(
_(
"""Failed to import module 'scour'.
Please make sure it is installed (e.g. using 'pip install scour'
or 'sudo apt-get install python3-scour') and try again.
"""
)
)
class ScourInkscape(inkex.OutputExtension):
"""Scour Inkscape Extension"""
# Scour options
def add_arguments(self, pars):
pars.add_argument("--tab")
pars.add_argument("--simplify-colors", type=inkex.Boolean, dest="simple_colors")
pars.add_argument("--style-to-xml", type=inkex.Boolean)
pars.add_argument(
"--group-collapsing", type=inkex.Boolean, dest="group_collapse"
)
pars.add_argument("--create-groups", type=inkex.Boolean, dest="group_create")
pars.add_argument("--enable-id-stripping", type=inkex.Boolean, dest="strip_ids")
pars.add_argument("--shorten-ids", type=inkex.Boolean)
pars.add_argument("--shorten-ids-prefix")
pars.add_argument("--embed-rasters", type=inkex.Boolean)
pars.add_argument(
"--keep-unreferenced-defs", type=inkex.Boolean, dest="keep_defs"
)
pars.add_argument("--keep-editor-data", type=inkex.Boolean)
pars.add_argument("--nonsci-output", type=inkex.Boolean)
pars.add_argument("--remove-metadata", type=inkex.Boolean)
pars.add_argument("--strip-xml-prolog", type=inkex.Boolean)
pars.add_argument("--set-precision", type=int, dest="digits")
pars.add_argument("--indent", dest="indent_type")
pars.add_argument("--nindent", type=int, dest="indent_depth")
pars.add_argument("--line-breaks", type=inkex.Boolean, dest="newlines")
pars.add_argument(
"--strip-xml-space", type=inkex.Boolean, dest="strip_xml_space_attribute"
)
pars.add_argument("--protect-ids-noninkscape", type=inkex.Boolean)
pars.add_argument("--protect-ids-list")
pars.add_argument("--protect-ids-prefix")
pars.add_argument("--enable-viewboxing", type=inkex.Boolean)
pars.add_argument(
"--enable-comment-stripping", type=inkex.Boolean, dest="strip_comments"
)
pars.add_argument("--renderer-workaround", type=inkex.Boolean)
# options for internal use of the extension
pars.add_argument("--scour-version")
pars.add_argument("--scour-version-warn-old", type=inkex.Boolean)
def save(self, stream):
# version check if enabled in options
if self.options.scour_version_warn_old:
scour_version = scour.__version__
scour_version_min = self.options.scour_version
if Version(scour_version) < Version(scour_version_min):
raise inkex.AbortExtension(
f"""
The extension 'Optimized SVG Output' is designed for Scour {scour_version_min} or later but you're
using the older version Scour {scour_version}.
Note: You can permanently disable this message on the 'About' tab of the extension window."""
)
del self.options.scour_version
del self.options.scour_version_warn_old
# do the scouring
stream.write(scourString(self.svg.tostring(), self.options).encode("utf8"))
if __name__ == "__main__":
ScourInkscape().run()

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 33 KiB

View file

@ -1,19 +1,22 @@
############################################################################### ###############################################################################
# ##
# Copyright (C) 2010 Jeff Schiller, 2010 Louis Simard, 2013-2015 Tavendo GmbH ## Copyright (C) 2013 Tavendo GmbH
# ##
# Licensed under the Apache License, Version 2.0 (the "License"); ## Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. ## you may not use this file except in compliance with the License.
# You may obtain a copy of the License at ## You may obtain a copy of the License at
# ##
# http://www.apache.org/licenses/LICENSE-2.0 ## http://www.apache.org/licenses/LICENSE-2.0
# ##
# Unless required by applicable law or agreed to in writing, software ## Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, ## distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and ## See the License for the specific language governing permissions and
# limitations under the License. ## limitations under the License.
# ##
############################################################################### ###############################################################################
__version__ = u'0.38.2' import scour
import svg_regex
import svg_transform
import yocto_css

File diff suppressed because it is too large Load diff

View file

@ -1,28 +0,0 @@
class ScourStats(object):
__slots__ = (
'num_elements_removed',
'num_attributes_removed',
'num_style_properties_fixed',
'num_bytes_saved_in_colors',
'num_ids_removed',
'num_comments_removed',
'num_style_properties_fixed',
'num_rasters_embedded',
'num_path_segments_removed',
'num_points_removed_from_polygon',
'num_bytes_saved_in_path_data',
'num_bytes_saved_in_colors',
'num_bytes_saved_in_comments',
'num_bytes_saved_in_ids',
'num_bytes_saved_in_lengths',
'num_bytes_saved_in_transforms',
)
def __init__(self):
self.reset()
def reset(self):
# Set all stats to 0
for attr in self.__slots__:
setattr(self, attr, 0)

View file

@ -1,6 +1,6 @@
# This software is OSI Certified Open Source Software. # This software is OSI Certified Open Source Software.
# OSI Certified is a certification mark of the Open Source Initiative. # OSI Certified is a certification mark of the Open Source Initiative.
# #
# Copyright (c) 2006, Enthought, Inc. # Copyright (c) 2006, Enthought, Inc.
# All rights reserved. # All rights reserved.
# #
@ -41,22 +41,15 @@ Out[4]: [('M', [(0.60509999999999997, 0.5)])]
In [5]: svg_parser.parse('M 100-200') # Another edge case In [5]: svg_parser.parse('M 100-200') # Another edge case
Out[5]: [('M', [(100.0, -200.0)])] Out[5]: [('M', [(100.0, -200.0)])]
""" """
from __future__ import absolute_import
import re import re
from decimal import Decimal, getcontext from decimal import *
from functools import partial
# Sentinel. # Sentinel.
class _EOF(object): class _EOF(object):
def __repr__(self): def __repr__(self):
return 'EOF' return 'EOF'
EOF = _EOF() EOF = _EOF()
lexicon = [ lexicon = [
@ -76,7 +69,6 @@ class Lexer(object):
http://www.gooli.org/blog/a-simple-lexer-in-python/ http://www.gooli.org/blog/a-simple-lexer-in-python/
""" """
def __init__(self, lexicon): def __init__(self, lexicon):
self.lexicon = lexicon self.lexicon = lexicon
parts = [] parts = []
@ -99,7 +91,6 @@ class Lexer(object):
break break
yield (EOF, None) yield (EOF, None)
svg_lexer = Lexer(lexicon) svg_lexer = Lexer(lexicon)
@ -154,148 +145,140 @@ class SVGPathParser(object):
def parse(self, text): def parse(self, text):
""" Parse a string of SVG <path> data. """ Parse a string of SVG <path> data.
""" """
gen = self.lexer.lex(text) next = self.lexer.lex(text).next
next_val_fn = partial(next, *(gen,)) token = next()
token = next_val_fn() return self.rule_svg_path(next, token)
return self.rule_svg_path(next_val_fn, token)
def rule_svg_path(self, next_val_fn, token): def rule_svg_path(self, next, token):
commands = [] commands = []
while token[0] is not EOF: while token[0] is not EOF:
if token[0] != 'command': if token[0] != 'command':
raise SyntaxError("expecting a command; got %r" % (token,)) raise SyntaxError("expecting a command; got %r" % (token,))
rule = self.command_dispatch[token[1]] rule = self.command_dispatch[token[1]]
command_group, token = rule(next_val_fn, token) command_group, token = rule(next, token)
commands.append(command_group) commands.append(command_group)
return commands return commands
def rule_closepath(self, next_val_fn, token): def rule_closepath(self, next, token):
command = token[1] command = token[1]
token = next_val_fn() token = next()
return (command, []), token return (command, []), token
def rule_moveto_or_lineto(self, next_val_fn, token): def rule_moveto_or_lineto(self, next, token):
command = token[1] command = token[1]
token = next_val_fn() token = next()
coordinates = [] coordinates = []
while token[0] in self.number_tokens: while token[0] in self.number_tokens:
pair, token = self.rule_coordinate_pair(next_val_fn, token) pair, token = self.rule_coordinate_pair(next, token)
coordinates.extend(pair) coordinates.extend(pair)
return (command, coordinates), token return (command, coordinates), token
def rule_orthogonal_lineto(self, next_val_fn, token): def rule_orthogonal_lineto(self, next, token):
command = token[1] command = token[1]
token = next_val_fn() token = next()
coordinates = [] coordinates = []
while token[0] in self.number_tokens: while token[0] in self.number_tokens:
coord, token = self.rule_coordinate(next_val_fn, token) coord, token = self.rule_coordinate(next, token)
coordinates.append(coord) coordinates.append(coord)
return (command, coordinates), token return (command, coordinates), token
def rule_curveto3(self, next_val_fn, token): def rule_curveto3(self, next, token):
command = token[1] command = token[1]
token = next_val_fn() token = next()
coordinates = [] coordinates = []
while token[0] in self.number_tokens: while token[0] in self.number_tokens:
pair1, token = self.rule_coordinate_pair(next_val_fn, token) pair1, token = self.rule_coordinate_pair(next, token)
pair2, token = self.rule_coordinate_pair(next_val_fn, token) pair2, token = self.rule_coordinate_pair(next, token)
pair3, token = self.rule_coordinate_pair(next_val_fn, token) pair3, token = self.rule_coordinate_pair(next, token)
coordinates.extend(pair1) coordinates.extend(pair1)
coordinates.extend(pair2) coordinates.extend(pair2)
coordinates.extend(pair3) coordinates.extend(pair3)
return (command, coordinates), token return (command, coordinates), token
def rule_curveto2(self, next_val_fn, token): def rule_curveto2(self, next, token):
command = token[1] command = token[1]
token = next_val_fn() token = next()
coordinates = [] coordinates = []
while token[0] in self.number_tokens: while token[0] in self.number_tokens:
pair1, token = self.rule_coordinate_pair(next_val_fn, token) pair1, token = self.rule_coordinate_pair(next, token)
pair2, token = self.rule_coordinate_pair(next_val_fn, token) pair2, token = self.rule_coordinate_pair(next, token)
coordinates.extend(pair1) coordinates.extend(pair1)
coordinates.extend(pair2) coordinates.extend(pair2)
return (command, coordinates), token return (command, coordinates), token
def rule_curveto1(self, next_val_fn, token): def rule_curveto1(self, next, token):
command = token[1] command = token[1]
token = next_val_fn() token = next()
coordinates = [] coordinates = []
while token[0] in self.number_tokens: while token[0] in self.number_tokens:
pair1, token = self.rule_coordinate_pair(next_val_fn, token) pair1, token = self.rule_coordinate_pair(next, token)
coordinates.extend(pair1) coordinates.extend(pair1)
return (command, coordinates), token return (command, coordinates), token
def rule_elliptical_arc(self, next_val_fn, token): def rule_elliptical_arc(self, next, token):
command = token[1] command = token[1]
token = next_val_fn() token = next()
arguments = [] arguments = []
while token[0] in self.number_tokens: while token[0] in self.number_tokens:
rx = Decimal(token[1]) * 1 rx = Decimal(token[1]) * 1
if rx < Decimal("0.0"): if rx < Decimal("0.0"):
raise SyntaxError("expecting a nonnegative number; got %r" % (token,)) raise SyntaxError("expecting a nonnegative number; got %r" % (token,))
token = next_val_fn() token = next()
if token[0] not in self.number_tokens: if token[0] not in self.number_tokens:
raise SyntaxError("expecting a number; got %r" % (token,)) raise SyntaxError("expecting a number; got %r" % (token,))
ry = Decimal(token[1]) * 1 ry = Decimal(token[1]) * 1
if ry < Decimal("0.0"): if ry < Decimal("0.0"):
raise SyntaxError("expecting a nonnegative number; got %r" % (token,)) raise SyntaxError("expecting a nonnegative number; got %r" % (token,))
token = next_val_fn() token = next()
if token[0] not in self.number_tokens: if token[0] not in self.number_tokens:
raise SyntaxError("expecting a number; got %r" % (token,)) raise SyntaxError("expecting a number; got %r" % (token,))
axis_rotation = Decimal(token[1]) * 1 axis_rotation = Decimal(token[1]) * 1
token = next_val_fn() token = next()
if token[1][0] not in ('0', '1'): if token[1] not in ('0', '1'):
raise SyntaxError("expecting a boolean flag; got %r" % (token,)) raise SyntaxError("expecting a boolean flag; got %r" % (token,))
large_arc_flag = Decimal(token[1][0]) * 1 large_arc_flag = Decimal(token[1]) * 1
if len(token[1]) > 1: token = next()
token = list(token) if token[1] not in ('0', '1'):
token[1] = token[1][1:]
else:
token = next_val_fn()
if token[1][0] not in ('0', '1'):
raise SyntaxError("expecting a boolean flag; got %r" % (token,)) raise SyntaxError("expecting a boolean flag; got %r" % (token,))
sweep_flag = Decimal(token[1][0]) * 1 sweep_flag = Decimal(token[1]) * 1
if len(token[1]) > 1: token = next()
token = list(token)
token[1] = token[1][1:]
else:
token = next_val_fn()
if token[0] not in self.number_tokens: if token[0] not in self.number_tokens:
raise SyntaxError("expecting a number; got %r" % (token,)) raise SyntaxError("expecting a number; got %r" % (token,))
x = Decimal(token[1]) * 1 x = Decimal(token[1]) * 1
token = next_val_fn() token = next()
if token[0] not in self.number_tokens: if token[0] not in self.number_tokens:
raise SyntaxError("expecting a number; got %r" % (token,)) raise SyntaxError("expecting a number; got %r" % (token,))
y = Decimal(token[1]) * 1 y = Decimal(token[1]) * 1
token = next_val_fn() token = next()
arguments.extend([rx, ry, axis_rotation, large_arc_flag, sweep_flag, x, y]) arguments.extend([rx, ry, axis_rotation, large_arc_flag, sweep_flag, x, y])
return (command, arguments), token return (command, arguments), token
def rule_coordinate(self, next_val_fn, token): def rule_coordinate(self, next, token):
if token[0] not in self.number_tokens: if token[0] not in self.number_tokens:
raise SyntaxError("expecting a number; got %r" % (token,)) raise SyntaxError("expecting a number; got %r" % (token,))
x = getcontext().create_decimal(token[1]) x = getcontext().create_decimal(token[1])
token = next_val_fn() token = next()
return x, token return x, token
def rule_coordinate_pair(self, next_val_fn, token):
def rule_coordinate_pair(self, next, token):
# Inline these since this rule is so common. # Inline these since this rule is so common.
if token[0] not in self.number_tokens: if token[0] not in self.number_tokens:
raise SyntaxError("expecting a number; got %r" % (token,)) raise SyntaxError("expecting a number; got %r" % (token,))
x = getcontext().create_decimal(token[1]) x = getcontext().create_decimal(token[1])
token = next_val_fn() token = next()
if token[0] not in self.number_tokens: if token[0] not in self.number_tokens:
raise SyntaxError("expecting a number; got %r" % (token,)) raise SyntaxError("expecting a number; got %r" % (token,))
y = getcontext().create_decimal(token[1]) y = getcontext().create_decimal(token[1])
token = next_val_fn() token = next()
return [x, y], token return [x, y], token

View file

@ -56,22 +56,15 @@ Multiple transformations are supported:
In [12]: svg_transform_parser.parse('translate(30 -30) rotate(36)') In [12]: svg_transform_parser.parse('translate(30 -30) rotate(36)')
Out[12]: [('translate', [30.0, -30.0]), ('rotate', [36.0])] Out[12]: [('translate', [30.0, -30.0]), ('rotate', [36.0])]
""" """
from __future__ import absolute_import
import re import re
from decimal import Decimal from decimal import *
from functools import partial
from six.moves import range
# Sentinel. # Sentinel.
class _EOF(object): class _EOF(object):
def __repr__(self): def __repr__(self):
return 'EOF' return 'EOF'
EOF = _EOF() EOF = _EOF()
lexicon = [ lexicon = [
@ -93,7 +86,6 @@ class Lexer(object):
http://www.gooli.org/blog/a-simple-lexer-in-python/ http://www.gooli.org/blog/a-simple-lexer-in-python/
""" """
def __init__(self, lexicon): def __init__(self, lexicon):
self.lexicon = lexicon self.lexicon = lexicon
parts = [] parts = []
@ -116,7 +108,6 @@ class Lexer(object):
break break
yield (EOF, None) yield (EOF, None)
svg_lexer = Lexer(lexicon) svg_lexer = Lexer(lexicon)
@ -154,90 +145,88 @@ class SVGTransformationParser(object):
def parse(self, text): def parse(self, text):
""" Parse a string of SVG transform="" data. """ Parse a string of SVG transform="" data.
""" """
gen = self.lexer.lex(text) next = self.lexer.lex(text).next
next_val_fn = partial(next, *(gen,))
commands = [] commands = []
token = next_val_fn() token = next()
while token[0] is not EOF: while token[0] is not EOF:
command, token = self.rule_svg_transform(next_val_fn, token) command, token = self.rule_svg_transform(next, token)
commands.append(command) commands.append(command)
return commands return commands
def rule_svg_transform(self, next_val_fn, token): def rule_svg_transform(self, next, token):
if token[0] != 'command': if token[0] != 'command':
raise SyntaxError("expecting a transformation type; got %r" % (token,)) raise SyntaxError("expecting a transformation type; got %r" % (token,))
command = token[1] command = token[1]
rule = self.command_dispatch[command] rule = self.command_dispatch[command]
token = next_val_fn() token = next()
if token[0] != 'coordstart': if token[0] != 'coordstart':
raise SyntaxError("expecting '('; got %r" % (token,)) raise SyntaxError("expecting '('; got %r" % (token,))
numbers, token = rule(next_val_fn, token) numbers, token = rule(next, token)
if token[0] != 'coordend': if token[0] != 'coordend':
raise SyntaxError("expecting ')'; got %r" % (token,)) raise SyntaxError("expecting ')'; got %r" % (token,))
token = next_val_fn() token = next()
return (command, numbers), token return (command, numbers), token
def rule_1or2numbers(self, next_val_fn, token): def rule_1or2numbers(self, next, token):
numbers = [] numbers = []
# 1st number is mandatory # 1st number is mandatory
token = next_val_fn() token = next()
number, token = self.rule_number(next_val_fn, token) number, token = self.rule_number(next, token)
numbers.append(number) numbers.append(number)
# 2nd number is optional # 2nd number is optional
number, token = self.rule_optional_number(next_val_fn, token) number, token = self.rule_optional_number(next, token)
if number is not None: if number is not None:
numbers.append(number) numbers.append(number)
return numbers, token return numbers, token
def rule_1number(self, next_val_fn, token): def rule_1number(self, next, token):
# this number is mandatory # this number is mandatory
token = next_val_fn() token = next()
number, token = self.rule_number(next_val_fn, token) number, token = self.rule_number(next, token)
numbers = [number] numbers = [number]
return numbers, token return numbers, token
def rule_1or3numbers(self, next_val_fn, token): def rule_1or3numbers(self, next, token):
numbers = [] numbers = []
# 1st number is mandatory # 1st number is mandatory
token = next_val_fn() token = next()
number, token = self.rule_number(next_val_fn, token) number, token = self.rule_number(next, token)
numbers.append(number) numbers.append(number)
# 2nd number is optional # 2nd number is optional
number, token = self.rule_optional_number(next_val_fn, token) number, token = self.rule_optional_number(next, token)
if number is not None: if number is not None:
# but, if the 2nd number is provided, the 3rd is mandatory. # but, if the 2nd number is provided, the 3rd is mandatory.
# we can't have just 2. # we can't have just 2.
numbers.append(number) numbers.append(number)
number, token = self.rule_number(next_val_fn, token) number, token = self.rule_number(next, token)
numbers.append(number) numbers.append(number)
return numbers, token return numbers, token
def rule_6numbers(self, next_val_fn, token): def rule_6numbers(self, next, token):
numbers = [] numbers = []
token = next_val_fn() token = next()
# all numbers are mandatory # all numbers are mandatory
for i in range(6): for i in xrange(6):
number, token = self.rule_number(next_val_fn, token) number, token = self.rule_number(next, token)
numbers.append(number) numbers.append(number)
return numbers, token return numbers, token
def rule_number(self, next_val_fn, token): def rule_number(self, next, token):
if token[0] not in self.number_tokens: if token[0] not in self.number_tokens:
raise SyntaxError("expecting a number; got %r" % (token,)) raise SyntaxError("expecting a number; got %r" % (token,))
x = Decimal(token[1]) * 1 x = Decimal(token[1]) * 1
token = next_val_fn() token = next()
return x, token return x, token
def rule_optional_number(self, next_val_fn, token): def rule_optional_number(self, next, token):
if token[0] not in self.number_tokens: if token[0] not in self.number_tokens:
return None, token return None, token
else: else:
x = Decimal(token[1]) * 1 x = Decimal(token[1]) * 1
token = next_val_fn() token = next()
return x, token return x, token

View file

@ -23,8 +23,8 @@
# scour needed a bare-minimum CSS parser in order to determine if some elements # scour needed a bare-minimum CSS parser in order to determine if some elements
# were still referenced by CSS properties. # were still referenced by CSS properties.
# I looked at css-py (a CSS parser built in Python), but that library # I looked at css-py (a CSS parser built in Python), but that library
# is about 35k of Python and requires ply to be installed. I just need # is about 35k of Python and requires ply to be installed. I just need
# something very basic to suit scour's needs. # something very basic to suit scour's needs.
# yocto-css takes a string of CSS and tries to spit out a list of rules # yocto-css takes a string of CSS and tries to spit out a list of rules
@ -45,32 +45,28 @@
# value : [ any | block | ATKEYWORD S* ]+; # value : [ any | block | ATKEYWORD S* ]+;
# any : [ IDENT | NUMBER | PERCENTAGE | DIMENSION | STRING # any : [ IDENT | NUMBER | PERCENTAGE | DIMENSION | STRING
# | DELIM | URI | HASH | UNICODE-RANGE | INCLUDES # | DELIM | URI | HASH | UNICODE-RANGE | INCLUDES
# | DASHMATCH | FUNCTION S* any* ')' # | DASHMATCH | FUNCTION S* any* ')'
# | '(' S* any* ')' | '[' S* any* ']' ] S*; # | '(' S* any* ')' | '[' S* any* ']' ] S*;
def parseCssString(str): def parseCssString(str):
rules = [] rules = []
# first, split on } to get the rule chunks # first, split on } to get the rule chunks
chunks = str.split('}') chunks = str.split('}')
for chunk in chunks: for chunk in chunks:
# second, split on { to get the selector and the list of properties # second, split on { to get the selector and the list of properties
bits = chunk.split('{') bits = chunk.split('{')
if len(bits) != 2: if len(bits) != 2: continue
continue rule = {}
rule = {} rule['selector'] = bits[0].strip()
rule['selector'] = bits[0].strip() # third, split on ; to get the property declarations
# third, split on ; to get the property declarations bites = bits[1].strip().split(';')
bites = bits[1].strip().split(';') if len(bites) < 1: continue
if len(bites) < 1: props = {}
continue for bite in bites:
props = {} # fourth, split on : to get the property name and value
for bite in bites: nibbles = bite.strip().split(':')
# fourth, split on : to get the property name and value if len(nibbles) != 2: continue
nibbles = bite.strip().split(':') props[nibbles[0].strip()] = nibbles[1].strip()
if len(nibbles) != 2: rule['properties'] = props
continue rules.append(rule)
props[nibbles[0].strip()] = nibbles[1].strip() return rules
rule['properties'] = props
rules.append(rule)
return rules

128
setup.py
View file

@ -1,87 +1,51 @@
############################################################################### ###############################################################################
# ##
# Copyright (C) 2013-2014 Tavendo GmbH ## Copyright (C) 2013 Tavendo GmbH
# ##
# Licensed under the Apache License, Version 2.0 (the "License"); ## Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. ## you may not use this file except in compliance with the License.
# You may obtain a copy of the License at ## You may obtain a copy of the License at
# ##
# http://www.apache.org/licenses/LICENSE-2.0 ## http://www.apache.org/licenses/LICENSE-2.0
# ##
# Unless required by applicable law or agreed to in writing, software ## Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, ## distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and ## See the License for the specific language governing permissions and
# limitations under the License. ## limitations under the License.
# ##
############################################################################### ###############################################################################
import os from setuptools import setup, find_packages
import re
from setuptools import find_packages, setup setup (
name = 'scour',
LONGDESC = """ version = '0.26',
Scour is an SVG optimizer/cleaner that reduces the size of scalable description = 'Scour SVG Optimizer',
vector graphics by optimizing structure and removing unnecessary data. long_description = open("README.md").read(),
license = 'Apache License 2.0',
It can be used to create streamlined vector graphics suitable for web author = 'Jeff Schiller',
deployment, publishing/sharing or further processing. author_email = 'codedread@gmail.com',
url = 'http://blog.codedread.com/',
The goal of Scour is to output a file that renders identically at a platforms = ('Any'),
fraction of the size by removing a lot of redundant information created install_requires = [],
by most SVG editors. Optimization options are typically lossless but can packages = find_packages(),
be tweaked for more aggressive cleaning. zip_safe = True,
entry_points = {
Website 'console_scripts': [
- http://www.codedread.com/scour/ (original website) 'scour = scour.scour:run'
- https://github.com/scour-project/scour (today) ]},
classifiers = ["License :: OSI Approved :: Apache Software License",
Authors: "Development Status :: 5 - Production/Stable",
- Jeff Schiller, Louis Simard (original authors) "Environment :: Console",
- Tobias Oberstein (maintainer) "Intended Audience :: Developers",
- Patrick Storz (maintainer) "Intended Audience :: System Administrators",
""" "Operating System :: OS Independent",
"Programming Language :: Python",
VERSIONFILE = os.path.join(os.path.dirname(os.path.realpath(__file__)), "scour", "__init__.py") "Topic :: Internet",
verstrline = open(VERSIONFILE, "rt").read() "Topic :: Software Development :: Build Tools",
VSRE = r"^__version__ = u['\"]([^'\"]*)['\"]" "Topic :: Software Development :: Pre-processors",
mo = re.search(VSRE, verstrline, re.M) "Topic :: Multimedia :: Graphics :: Graphics Conversion",
if mo: "Topic :: Utilities"],
verstr = mo.group(1) keywords = 'svg optimizer'
else:
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))
setup(
name='scour',
version=verstr,
description='Scour SVG Optimizer',
# long_description = open("README.md").read(),
long_description=LONGDESC,
license='Apache License 2.0',
author='Jeff Schiller',
author_email='codedread@gmail.com',
url='https://github.com/scour-project/scour',
platforms=('Any'),
install_requires=['six>=1.9.0'],
packages=find_packages(),
zip_safe=True,
entry_points={
'console_scripts': [
'scour = scour.scour:run'
]},
classifiers=["License :: OSI Approved :: Apache Software License",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Internet",
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Pre-processors",
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
"Topic :: Utilities"],
keywords='svg optimizer'
) )

View file

@ -1,57 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Test Harness for Scour
#
# Copyright 2010 Jeff Schiller
#
# This file is part of Scour, http://www.codedread.com/scour/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import unittest
from scour.yocto_css import parseCssString
class Blank(unittest.TestCase):
def runTest(self):
r = parseCssString('')
self.assertEqual(len(r), 0, 'Blank string returned non-empty list')
self.assertEqual(type(r), type([]), 'Blank string returned non list')
class ElementSelector(unittest.TestCase):
def runTest(self):
r = parseCssString('foo {}')
self.assertEqual(len(r), 1, 'Element selector not returned')
self.assertEqual(r[0]['selector'], 'foo', 'Selector for foo not returned')
self.assertEqual(len(r[0]['properties']), 0, 'Property list for foo not empty')
class ElementSelectorWithProperty(unittest.TestCase):
def runTest(self):
r = parseCssString('foo { bar: baz}')
self.assertEqual(len(r), 1, 'Element selector not returned')
self.assertEqual(r[0]['selector'], 'foo', 'Selector for foo not returned')
self.assertEqual(len(r[0]['properties']), 1, 'Property list for foo did not have 1')
self.assertEqual(r[0]['properties']['bar'], 'baz', 'Property bar did not have baz value')
if __name__ == '__main__':
unittest.main()

File diff suppressed because it is too large Load diff

31
tox.ini
View file

@ -1,31 +0,0 @@
[tox]
envlist =
pypy
py27
py34
py35
py36
py37
py38
py39
py310
flake8
[testenv]
deps =
six
coverage
commands =
scour --version
coverage run --parallel-mode --source=scour test_scour.py
[testenv:flake8]
deps =
flake8
commands =
flake8 --max-line-length=119

View file

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:x="http://ns.adobe.com/Extensibility/1.0/"
xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/"
xmlns:graph="http://ns.adobe.com/Graphs/1.0/"
xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
xmlns:f="http://ns.adobe.com/Flows/1.0/"
xmlns:ir="http://ns.adobe.com/ImageReplacement/1.0/"
xmlns:custom="http://ns.adobe.com/GenericCustomNamespace/1.0/"
xmlns:xpath="http://ns.adobe.com/XPath/1.0/"
xmlns:ok="A.namespace.we.want.left.in"
i:viewOrigin="190.2959 599.1841" i:rulerOrigin="0 0" i:pageBounds="0 792 612 0">
<x:foo>bar</x:foo>
<i:foo>bar</i:foo>
<graph:foo>bar</graph:foo>
<a:foo>bar</a:foo>
<f:foo>bar</f:foo>
<ir:foo>bar</ir:foo>
<custom:foo>bar</custom:foo>
<xpath:foo>bar</xpath:foo>
<variableSets xmlns="http://ns.adobe.com/Variables/1.0/">
<variableSet varSetName="binding1" locked="none">
<variables/>
<v:sampleDataSets xmlns="http://ns.adobe.com/GenericCustomNamespace/1.0/" xmlns:v="http://ns.adobe.com/Variables/1.0/"/>
</variableSet>
</variableSets>
<sfw xmlns="http://ns.adobe.com/SaveForWeb/1.0/">
<slices/>
<sliceSourceBounds y="191.664" x="190.296" width="225.72" height="407.52" bottomLeftOrigin="true"/>
</sfw>
<rect width="300" height="200" fill="green"
x:baz="1"
i:baz="1"
graph:baz="1"
a:baz="1"
f:baz="1"
ir:baz="1"
custom:baz='1'
xpath:baz="1"
xmlns:v="http://ns.adobe.Variables/1.0/"
v:baz="1"
xmlns:sfw="http://ns.adobe.com/SaveForWeb/1.0/"
sfw:baz="1"
ok:baz="1" />
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path style="fill-rule:evenodd;stroke-linecap:butt;stroke-width:1.00;stroke:#000" d="m1,1z"/>
<path style="fill-rule:nonzero;stroke-linecap:butt;stroke:#000" d="m1,1z"/>
<g style="stroke:#f00;marker:none">
<path style="marker-start:none;fill-rule:evenodd;stroke-linecap:butt" d="m1,1z"/>
<path style="fill-rule:nonzero" d="m1,1z"/>
<g style="fill:#f0f;text-anchor:stop;fill-rule:evenodd;stroke-linecap:round;marker:url(#nirvana)">
<path style="marker-start:none;fill-rule:evenodd;stroke-linecap:butt" d="m1,1z"/>
<path style="color:#000;fill-rule:nonzero;" d="m1,1z"/>
<path d="m1,1z"/>
</g>
<g style="fill:#f0f;text-anchor:stop;fill-rule:evenodd;stroke-linecap:round;marker:url(#nirvana)">
<path style="marker-start:none;fill-rule:evenodd;stroke-linecap:butt" d="m1,1z"/>
<path style="color:#000;fill-rule:nonzero;" d="m1,1z"/>
</g>
<g style="text-anchor:stop;fill-rule:nonzero;marker:none;stroke-linecap:butt">
<path style="marker-start:none;fill-rule:evenodd;stroke-linecap:butt" d="m1,1z"/>
<path style="fill-rule:nonzero;" d="m1,1z"/>
<path d="m1,1z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<script type="application/ecmascript"><![CDATA[
alert('pb&j');
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 184 B

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="g1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="blue" />
<stop offset="1" stop-color="yellow" />
</linearGradient>
<radialGradient id="g2" xlink:href="#g1" cx="50%" cy="50%" r="30%" gradientUnits="objectBoundingBox"/>
</defs>
<rect fill="url(#g2)" width="200" height="200"/>
</svg>

Before

Width:  |  Height:  |  Size: 507 B

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="g1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="blue" />
<stop offset="1" stop-color="yellow" />
</linearGradient>
<radialGradient id="g2" xlink:href="#g1" cx="100" cy="100" r="70"/>
<radialGradient id="g3" xlink:href="#g2" cx="100" cy="100" r="70"/>
</defs>
<rect fill="url(#g1)" width="200" height="200"/>
<rect fill="url(#g3)" width="200" height="200" y="200"/>
</svg>

Before

Width:  |  Height:  |  Size: 599 B

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="grad1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" spreadMethod="reflect" gradientTransform="matrix(1,2,3,4,5,6)">
<stop offset="0" stop-color="blue" />
<stop offset="1" stop-color="yellow" />
</linearGradient>
<radialGradient id="grad2" xlink:href="#grad1" cx="100" cy="100" r="70"/>
</defs>
<rect fill="url(#grad2)" width="200" height="200"/>
</svg>

Before

Width:  |  Height:  |  Size: 547 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="210" height="210">
<path stroke="yellow" fill="red" d="M100,100 L200.12345,200.12345 C215,205 185,195 200.12345,200.12345 Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 281 B

View file

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="dot">
<circle r="5px"/>
</marker>
</defs>
<!-- h/v commands should be collapsed into a single h/v commands -->
<path d="m0 0h10 20"/>
<path d="m0 0v10 20"/>
<path d="m0 0h10 0.5v10 0.5"/>
<!-- h/v commands should not be collapsed if they have different direction -->
<path d="m0 0h10 -1v10 -1"/>
<!-- h/v commands should also be collapsed if only start/end markers are present -->
<path d="m0 0h10 20" marker-start="url(#dot)" marker-end="url(#dot)"/>
<path d="m0 0h10 20" style="marker-start:url(#dot);marker-end:url(#dot)"/>
<!-- h/v commands should be preserved if intermediate markers are present -->
<path d="m0 0h10 20" marker="url(#dot)"/>
<path d="m0 0h10 20" marker-mid="url(#dot)"/>
<path d="m0 0h10 20" style="marker:url(#dot)"/>
<path d="m0 0h10 20" style="marker-mid:url(#dot)"/>
<!-- all consecutive lineto commands pointing into the sam direction
should be collapsed into a single (implicit if possible) lineto command -->
<path d="m 0 0 l 10 20 0.25 0.5 l 0.75 1.5 l 5 10 0.2 0.4 l 3 6 0.8 1.6 l 0 1 l 1 2 9 18"/>
<!-- must not be collapsed (same slope, but different direction) -->
<path d="m 0 0 10 10 -20 -20 l 10 10 -20 -20"/>
<!-- first parameter pair of a moveto subpath must not be collapsed as it's not drawn on canvas -->
<path d="m0 0 1 2 m 1 2 1 2l 1 2 m 1 2 1 2 1 2"/>
<!-- real world example of straight path with multiple nodes -->
<path d="m 6.3227953,7.1547422 10.6709787,5.9477588 9.20334,5.129731 22.977448,12.807101 30.447251,16.970601 7.898986,4.402712"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs>
<linearGradient id="g1" x1="0" y1="0" x2="1" y2="0">
<stop offset="0.5" stop-color="rgb(50.0%, 0%, .0%)" />
</linearGradient>
<solidColor id="c1" solid-color="lightgoldenrodyellow"/>
</defs>
<rect id="rect" width="100" height="100" fill="rgb(15,16,17)" stroke="darkgrey" />
<circle id="circle" cx="100" cy="100" r="30" fill="url(#g1)" stroke="url(#c1)" />
<ellipse id="ellipse" cx="100" cy="100" rx="30" ry="30" style="fill:#ffffff" fill="black" />
</svg>

Before

Width:  |  Height:  |  Size: 589 B

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- Oh look a comment -->
<!-- generated by foobar version 20120503 -->
<!-- And another -->
<svg xmlns="http://www.w3.org/2000/svg">
<!-- This comment is meant to test whether removing a comment before <svg>
messes up removing comments thereafter -->
<!-- And this one is meant to test whether iteration works correctly in
<svg> as well as the document element -->
</svg>

Before

Width:  |  Height:  |  Size: 448 B

View file

@ -1,6 +0,0 @@
<?xml version="1.0" ?>
<!-- Empty -->
<!-- Comment #2 -->
<svg xmlns="http://www.w3.org/2000/svg">
</svg>
<!-- After -->

Before

Width:  |  Height:  |  Size: 121 B

View file

@ -1,9 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="g">
<rect width="200" height="100" fill="#0f0"/>
<rect width="200" height="100" fill="#0f0"/>
<rect width="200" height="100" fill="#0f0"/>
<circle id="e" r="20" fill="#0f0"/>
</g>
<use xlink:href="#e" />
</svg>

Before

Width:  |  Height:  |  Size: 324 B

View file

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="g1">
<stop offset="0" stop-color="red"/>
<stop offset="1" stop-color="blue"/>
</linearGradient>
<linearGradient id="g2">
<stop offset="0" stop-color="green"/>
<stop offset="1" stop-color="yellow"/>
</linearGradient>
</defs>
<style type="text/css"><![CDATA[
rect {
stroke: red;
stroke-width: 10;
fill:url(#g1)
}
]]></style>
<style type="text/css">.circ { fill: none; stroke: url("#g2"); stroke-width: 15 }</style>
<rect height="300" width="300"/>
<circle class="circ" cx="350" cy="350" r="40"/>
</svg>

Before

Width:  |  Height:  |  Size: 691 B

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<title>This is a title element with only text node children</title>
<desc>This is a desc element with only text node children</desc>
<metadata>This is a metadata element with only text node children</metadata>
</svg>

Before

Width:  |  Height:  |  Size: 319 B

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- comment -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/>

Before

Width:  |  Height:  |  Size: 350 B

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="g1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="blue" />
<stop offset="1" stop-color="yellow" />
</linearGradient>
<radialGradient id="g2" xlink:href="#g1" cx="100" cy="100" r="70"/>
<radialGradient id="g3" xlink:href="#g1" cx="100" cy="100" r="70"/>
</defs>
<rect fill="url(#g2)" width="200" height="200"/>
<rect fill="url(#g3)" width="200" height="200" y="200"/>
</svg>

Before

Width:  |  Height:  |  Size: 599 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<rect fill="red" width="100" height="100" />
</svg>

Before

Width:  |  Height:  |  Size: 149 B

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs>
<linearGradient id="sea-gradient" x1="0" x2="0" y1="0" y2="1">
<stop offset="0%" stop-color="lightgrey"/>
<stop offset="0.5" stop-color="darkgrey"/>
<stop offset="50%" stop-color="darkgrey"/>
<stop offset="100%" stop-color="white"/>
</linearGradient>
</defs>
<rect style="fill: url(#sea-gradient) rgb(0, 0, 0);" y="0" x="0" height="100" width="100"/>
</svg>

Before

Width:  |  Height:  |  Size: 497 B

View file

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="lingrad" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="red" />
<stop offset="0.5" stop-color="blue" />
<stop offset="0.5" stop-color="blue" />
<stop offset="1.0" stop-color="green" />
</linearGradient>
<radialGradient id="radgrad">
<stop offset="0" stop-color="red" />
<stop offset="0.5" stop-color="blue" />
<stop offset="0.5" stop-color="blue" />
<stop offset="1.0" stop-color="green" />
</radialGradient>
</defs>
<rect width="300" height="300" fill="url(#lingrad)" />
<rect width="300" height="300" fill="url(#radgrad)" />
</svg>

Before

Width:  |  Height:  |  Size: 740 B

View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="duplicate-one" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="blue" />
<stop offset="1" stop-color="yellow" />
</linearGradient>
<linearGradient id="duplicate-two" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="blue" />
<stop offset="1" stop-color="yellow" />
</linearGradient>
</defs>
<rect style="fill: url(#duplicate-one)" width="200" height="200"/>
<rect style="fill: url(#duplicate-two)" width="200" height="200" y="200"/>
<rect style="fill: url(#duplicate-two) #fff" width="200" height="200" y="200"/>
</svg>

Before

Width:  |  Height:  |  Size: 788 B

View file

@ -1,5 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg">
<title></title>
<desc></desc>
<metadata></metadata>
</svg>

Before

Width:  |  Height:  |  Size: 106 B

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g/>
<g transform="translate(10,10)">
<rect width="300" height="200" fill="green" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 203 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" ?>
<svg xmlns="http://www.w3.org/2000/svg">
<style id="style1" />
</svg>

Before

Width:  |  Height:  |  Size: 97 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-15" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<desc>áèîäöüߤ¦¨´¸¼½¾</desc>
</svg>

Before

Width:  |  Height:  |  Size: 139 B

View file

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<desc id="hello">Hello in many languages:
ar: أهلا
bn: হ্যালো
el: Χαίρετε
en: Hello
hi: नमस्ते
iw: שלום
ja: こんにちは
km: ជំរាបសួរ
ml: ഹലോ
ru: Здравствуйте
ur: ہیلو
zh: 您好</desc>
<desc id="common">“”—…°©®™•½¼¾⅓⅔†‡µ¢£€«»♠♣♥♦¿<EFBFBD></desc>
<desc id="math">:-×÷±∞π∅≤≥≠≈∧∨∩∪∈∀∃∄∑∏←↑→↓↔↕↖↗↘↙↺↻⇒⇔</desc>
<desc id="supersub">⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁽⁾ⁿⁱ₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎</desc>
</svg>

Before

Width:  |  Height:  |  Size: 731 B

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
a="'"
b='"'
c="''&quot;"
d='""&apos;'
e='&apos;&apos;""'
/>

Before

Width:  |  Height:  |  Size: 144 B

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<path style="fill: none; fill-rule: nonzero; fill-opacity: 0.5;" d="M 7.7592046,36.982095 C 7.8831049,40.873696 7.8339808,45.305308 7.8339808,49.436888 Z" />
<path style="fill: black; fill-rule: evenodd; fill-opacity: 0.5;" d="M 7.7592046,36.982095 C 7.8831049,40.873696 7.8339808,45.305308 7.8339808,49.436888 Z" />
</svg>

Before

Width:  |  Height:  |  Size: 430 B

View file

@ -1,66 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="210mm"
height="297mm"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="flowtext-less.svg">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="350"
inkscape:cy="520"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1559"
inkscape:window-height="876"
inkscape:window-x="41"
inkscape:window-y="24"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1">
<text
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="142.85715"
y="638.07648"
id="text2997"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan2999"
x="142.85715"
y="638.07648">abcd</tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="210mm"
height="297mm"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="Neues Dokument 1">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="350"
inkscape:cy="520"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="936"
inkscape:window-height="631"
inkscape:window-x="41"
inkscape:window-y="24"
inkscape:window-maximized="0" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1">
<flowRoot
xml:space="preserve"
id="flowRoot2985"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><flowRegion
id="flowRegion2987"><rect
id="rect2989"
width="480"
height="262.85715"
x="45.714287"
y="218.07646" /></flowRegion><flowPara
id="flowPara2991">sfdadasd</flowPara><flowPara
id="flowPara2993">asdasd</flowPara><flowPara
id="flowPara2995">adsa</flowPara></flowRoot> <text
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="142.85715"
y="638.07648"
id="text2997"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan2999"
x="142.85715"
y="638.07648">abcd</tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<rect style="font-size:20px" width="100" height="100" />
</svg>

Before

Width:  |  Height:  |  Size: 162 B

View file

@ -1,31 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg">
<title xmlns:mytitle="http://example.org/mytitle">
<mytitle:title>This is an example SVG file</mytitle:title>
<mytitle:desc>Unit test for Scour's --remove-titles option</mytitle:desc>
</title>
<desc xmlns:mydesc="http://example.org/mydesc">
<mydesc:title>This is an example SVG file</mydesc:title>
<mydesc:para>Unit test for Scour's
<mydesc:emph>--remove-descriptions</mydesc:emph> option</mydesc:para>
</desc>
<metadata>
<rdf:RDF
xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs = "http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc = "http://purl.org/dc/elements/1.1/" >
<rdf:Description about="http://example.org/myfoo"
dc:title="MyFoo"
dc:description="Unit test for Scour's --remove-metadata option"
dc:publisher="No One"
dc:date="2010-06-09"
dc:format="image/svg+xml"
dc:language="en" >
<dc:creator>
<rdf:Bag>
<rdf:li>No One</rdf:li>
</rdf:Bag>
</dc:creator>
</rdf:Description>
</rdf:RDF>
</metadata>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<linearGradient id="grad1" x1="0" y1='0' x2='100%' y2='0.0' gradientUnits="objectBoundingBox" spreadMethod="pad">
<stop offset="0" stop-color="black"/>
<stop offset="1" stop-color="white"/>
</linearGradient>
<linearGradient id="grad1b" x2='1.0' gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="black"/>
<stop offset="1" stop-color="white"/>
</linearGradient>
<linearGradient id="grad1c" x2='1' gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="black"/>
<stop offset="1" stop-color="white"/>
</linearGradient>
<radialGradient id="grad2" xlink:href="#grad1" cx="50%" cy="0.5" r="50%" fx="50%" fy="0.5"/>
<rect width="100" height="100" fill="url(#grad1)"/>
<rect width="100" height="100" fill="url(#grad1b)"/>
<rect width="100" height="100" fill="url(#grad1c)"/>
<rect width="50" height="50" fill="url(#grad2)"/>
</svg>

Before

Width:  |  Height:  |  Size: 1 KiB

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<rect fill="red" stroke="blue" x="0" y="0" width="4" height="4" />
<rect fill="red" stroke="blue" x="8" y="0" width="4" height="4" />
<rect fill="red" stroke="blue" x="16" y="0" width="4" height="4" />
</svg>

Before

Width:  |  Height:  |  Size: 317 B

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg height="100" width="100" xmlns="http://www.w3.org/2000/svg" >
<text>
<tspan x="10" y="30" style="font-family:sans-serif">text1</tspan>
<tspan x="10" y="50" style="font-family:sans-serif">text2</tspan>
<tspan x="10" y="70" style="font-family:sans-serif">text3</tspan>
</text>
</svg>

Before

Width:  |  Height:  |  Size: 350 B

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<rect fill="green" stroke="blue" x="0" y="0" width="4" height="4" />
<rect fill="yellow" stroke="red" x="8" y="0" width="4" height="4" />
<rect fill="blue" stroke="red" x="16" y="0" width="4" height="4" />
</svg>

Before

Width:  |  Height:  |  Size: 321 B

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" viewBox="0 0 141.732 141.732" xml:space="preserve">
<g>
<g clip-path="url(#SVGID_2_)">
<path d="M1,1" fill="#fdebc8" stroke="#000" stroke-width=".5" stroke-miterlimit="10"/>
</g>
<g clip-path="url(#SVGID_2_)">
<g>
<path opacity=".5" clip-path="url(#SVGID_4_)" fill="#fff" d="M1,1"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 528 B

View file

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<desc>Produced by GNUPLOT 5.2 patchlevel 8</desc>
<rect width="900" height="600" fill="none"/>
<g color="black" fill="none">
<path d="m88.5 564h9m777.5 0h-9" stroke="#000"/>
<g transform="translate(80.2,567.9)" fill="#000" font-family="Arial" font-size="12" text-anchor="end">
<text><tspan font-family="Arial">0</tspan></text>
</g>
</g>
<g color="black" fill="none">
<path d="m88.5 473h9m777.5 0h-9" stroke="#000"/>
<g transform="translate(80.2,476.9)" fill="#000" font-family="Arial" font-size="12" text-anchor="end">
<text><tspan font-family="Arial">5000</tspan></text>
</g>
</g>
<g color="black" fill="none">
<path d="m88.5 382h9m777.5 0h-9" stroke="#000"/>
<g transform="translate(80.2,385.9)" fill="#000" font-family="Arial" font-size="12" text-anchor="end">
<text><tspan font-family="Arial">10000</tspan></text>
</g>
</g>
<g color="black" fill="none">
<path d="m88.5 291h9m777.5 0h-9" stroke="#000"/>
<g transform="translate(80.2,294.9)" fill="#000" font-family="Arial" font-size="12" text-anchor="end">
<text><tspan font-family="Arial">15000</tspan></text>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:example="http://www.example.com/olfactory-feedback/0.1"
xmlns:xlink="http://www.w3.org/1999/xlink">
<switch>
<foreignObject requiredExtensions="http://www.example.com/olfactory-feedback/0.1" x="0" y="0" width="1" height="1">
<example:odor xlink:href="#odor1423">
</example:odor>
</foreignObject>
<g id="dsfargeg">
<rect width="300" height="200" fill="green" />
<circle cx="200" cy="100" r="50" fill="yellow" />
</g>
</switch>
<defs>
<example:odor id="odor1423" fill="grape"/>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 609 B

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:example="http://www.example.com/olfactory-feedback/0.1"
xmlns:xlink="http://www.w3.org/1999/xlink">
<switch>
<foreignObject requiredExtensions="http://www.example.com/olfactory-feedback/0.1" x="0" y="0" width="1" height="1">
<example:odor xlink:href="#odor1423">
</example:odor>
</foreignObject>
<g>
<rect width="300" height="200" fill="green" />
<circle cx="200" cy="100" r="50" fill="yellow" />
</g>
</switch>
<defs>
<example:odor id="odor1423" fill="grape"/>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 595 B

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g>
<title>Group 1</title>
<rect width="300" height="200" fill="green" />
<circle cx="200" cy="100" r="50" fill="yellow" />
</g>
<g>
<desc>Group 1</desc>
<rect width="300" height="200" fill="green" />
<circle cx="200" cy="100" r="50" fill="yellow" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 365 B

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="110" width="100">
<text id="text1" x="10" y="20">Text 1</text>
<text id="text2" x="10" y="40">Text 2</text>
<text id="text3" x="10" y="60">Text 3</text>
<text id="text_custom" x="10" y="80">Text custom</text>
<text id="my_text1" x="10" y="100">My text</text>
</svg>

Before

Width:  |  Height:  |  Size: 358 B

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" id="boo">
<defs>
<title id="title1">Fooey</title>
<rect id='r1' />
<linearGradient id="Polka_Dot_Pattern">
<stop offset="0.5" stop-color="blue" id="stop1234"/>
</linearGradient>
</defs>
<rect id='r2' fill="url(#Polka_Dot_Pattern)" />
</svg>

Before

Width:  |  Height:  |  Size: 348 B

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg id="svg1" xmlns="http://www.w3.org/2000/svg" height="100" width="100" viewBox="0 0 100 100">
<defs>
<linearGradient id="linearGradient1">
<stop offset="0"/>
<stop offset="1" stop-color="blue"/>
</linearGradient>
</defs>
<g id="layer1">
<rect id="rect1" height="50" width="50" x="10" y="10" fill="url(#linearGradient1)"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 425 B

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<g>
<linearGradient id="g1">
<stop offset="0" stop-color="blue"/>
<stop offset="1" stop-color="red"/>
</linearGradient>
</g>
</defs>
<rect fill="url(#g1)" width="100" height="100" />
</svg>

Before

Width:  |  Height:  |  Size: 305 B

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:foo="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="0.46" version="1.0">
<inkscape:perspective inkscape:vp_x="0 : 526.18109 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="744.09448 : 526.18109 : 1" inkscape:persp3d-origin="372.04724 : 350.78739 : 1" id="perspective3104"/>
<rect width="300" height="200" fill="green" inkscape:collect="always" foo:bar="1"/>
</svg>

Before

Width:  |  Height:  |  Size: 545 B

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"/>

Before

Width:  |  Height:  |  Size: 81 B

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g id="grampa" fill-opacity="0.4">
<g stroke-opacity="0.8">
<rect fill="#0F0" stroke="#0F0" stroke-width="5" width="100" height="300"/>
<rect fill="#0F0" width="200" height="100" />
</g>
<circle fill="#0F0" stroke="0F0" cx="50" cy="50" r="20" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 368 B

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g fill-opacity="0.4">
<rect fill="#0F0" stroke="#0F0" stroke-width="5" width="100" height="300"/>
<rect fill="#0F0" width="200" height="100" />
<circle fill="#0F0" stroke="0F0" cx="50" cy="50" r="20" />
</g>
<text>Hello
<tspan font-style="italic">World!</tspan>
Goodbye
<tspan font-style="italic">Cruel World!</tspan>
</text>
</svg>

Before

Width:  |  Height:  |  Size: 436 B

View file

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<defs>
<linearGradient id="linearGradient662">
<stop style="stop-color:#000000;stop-opacity:1" offset="0"/>
<stop style="stop-color:#0000ff;stop-opacity:1" offset="1"/>
</linearGradient>
</defs>
<linearGradient x1="120.22393" y1="156.07137" x2="119.33763" y2="162.87338" id="linearGradient3211" xlink:href="#linearGradient662" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0.789103,0,0,1.131232,0.366124,452.0845)"/>
</defs>
<path d="m50 50h50v50h-50z" fill="url(#linearGradient3211)"/>
</svg>

Before

Width:  |  Height:  |  Size: 732 B

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g>
<g transform="translate(50,50)">
<rect width="300" height="200" fill="green" />
<circle cx="200" cy="100" r="50" fill="yellow" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 253 B

View file

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
>
<!-- this file has pretty messed up formatting --> <rect width="100" height="100"/>
<rect width="100" height="100"/>
<rect width="100" height="100"/>
<rect width="100" height="100"/>
<rect width="100" height="100"/>
<rect width="100" height="100"/>
<!-- we have mixed newline
characters, carriage returns and both of them
as well as tabs and spaces
-->
<rect width="100" height="100"/><rect width="100" height="100"/> <rect width="100" height="100"/>
<rect width="100" height="100"/> <rect width="100" height="100"/> <rect width="100" height="100"/>
<rect width="100" height="100"/> <rect width="100" height="100"/>
</svg>
<!-- OMG, really? -->

Before

Width:  |  Height:  |  Size: 889 B

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"
viewBox="0.1 -0.333 125 125" xml:space="preserve">
<g id="Layer_1_2_">
<path d="M24.599,16.542v27.584l-4.994-1.033L0,60.671l52.687,63.612l51.361-40.729l20.844-18.664c0,0-23.527-4.871-27.404-5.673
c0-4.4,0-47.951,0-47.951L43.071,0L24.599,16.542z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 415 B

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<marker id="m1" orient="auto">
<rect width="200" height="100"/>
</marker>
<marker id="m2" orient="0">
<rect width="200" height="100"/>
</marker>
</defs>
<line x2="100" y2="100" style="marker-start:url(#m1);marker-end:url(#m2)" stroke="#000" />
</svg>

Before

Width:  |  Height:  |  Size: 414 B

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<marker id="m1" style="overflow:visible">
<rect width="200" height="100"/>
</marker>
<marker id="m2" style="overflow:hidden">
<rect width="200" height="100"/>
</marker>
</defs>
<line x2="100" y2="100" style="marker-start:url(#m1);marker-end:url(#m2)" stroke="#000" />
</svg>

Before

Width:  |  Height:  |  Size: 438 B

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="overflow:visible">
<svg style="overflow:hidden">
<line x2="100" y2="100" stroke="#000" />
</svg>
<svg style="overflow:visible">
<line x2="100" y2="100" stroke="#000" />
</svg>
</svg>

Before

Width:  |  Height:  |  Size: 344 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<path d="M 385,201 V181 l100,-50 h20 C 505.43501,223.44223 659.42238,164.82405 714.32160,-0.0015300000 C 649.90356,227.13187 497.48814,312.46353 371.30643,277.40123 C 245.12472,242.33893 157.17674,250.88268 121.69357,12.440270 C 211.69357,149.44027 323.87473,190.08578 385.88362,201.47812 z " fill="blue"/>
</svg>

Before

Width:  |  Height:  |  Size: 416 B

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
<path id="path1" d="m10,100c50-50,50,50,100,0,50-50,50,50,100,0" fill="none" stroke="blue" stroke-width="5"/>
<path id="path2a" d="m200,200c0,0 200,100 200,0" fill="none" stroke="red" stroke-width="5"/>
<path id="path2b" d="m0,300s200-100 200,0c0,0 200,100 200,0" fill="none" stroke="green" stroke-width="5"/>
</svg>

Before

Width:  |  Height:  |  Size: 455 B

View file

@ -1,8 +0,0 @@
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg">
<path d="m100 100 l200 100 m0 0z" />
<path d="m100 100 v200 m0 0 100 100z" />
<path d="m100 100 v200 m0 0m0 0 2-1-2 1z" />
<path d="m100 100 v200 m0 0 3-5-5 3m0 0 2-1-2 1z" />
<path d="m100 100 v200 m0 0 3-5-5 3zm0 0 2-1-2 1z" />
</svg>

Before

Width:  |  Height:  |  Size: 310 B

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="-100 -50 300 150" xmlns="http://www.w3.org/2000/svg">
<path d="m0 0a100 50 0 0 0 100 50" fill="none" stroke="#000"/>
<path d="m0 0a100 50 0 0 0100 50" fill="none" stroke="green"/>
<path d="m0 0a100 50 0 00 100 50" fill="none" stroke="blue"/>
<path d="m0 0a100 50 0 00100 50" fill="none" stroke="red"/>
</svg>

Before

Width:  |  Height:  |  Size: 370 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<path stroke="#000" d="M100,100,100,200 M300,100,100,100 M300,200,300,100" fill="none"/>
</svg>

Before

Width:  |  Height:  |  Size: 193 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" version="1.1">
<path d="M 100,100 l200,0 l0,100 h-200 l0,0 z" fill="blue" />
</svg>

Before

Width:  |  Height:  |  Size: 203 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="210" height="210">
<path stroke="yellow" fill="red" d="M100,100 L200.12345,200.12345 C215,205 185,195 200.12,200.12 Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 275 B

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<path d="m 1.11 2.22 3.33 4.44
M 0 0
C 1.11 2.22 3.33 4.44 5.55 6.66
c 1.11 2.22 3.33 4.44 5.55 6.66 1.11 2.22 3.33 4.44 5.55 6.66
M 0 0
S 1.11 2.22 3.33 4.44
s 1.11 2.22 3.33 4.44 1.11 2.22 3.33 4.44
M 0 0
Q 1.11 2.22 3.33 4.44
q 1.11 2.22 3.33 4.44 1.11 2.22 3.33 4.44" />
</svg>

Before

Width:  |  Height:  |  Size: 463 B

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<path id="p0" d="M 100.0000001 99.9999999 h100.01 v123456789.123456789 h-100 z" />
<path id="p1" d="m 1 21 321 4321 54321 654321 " />
<path id="p2" d="m 1.0 21.0 321.0 4321.0 54321.0 654321.0" />
<path id="p3" d="m 01 021 0321 04321 054321 0654321 " />
<path id="p4" d="m -1 -21 -321 -4321 -54321 -654321 " />
<path id="p6" d="m 123.456 101.001 -123.456 -101.001" />
</svg>

Before

Width:  |  Height:  |  Size: 517 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
<path d="m10,100q50-50,100,0,50,50,100,0" fill="none" stroke="blue" stroke-width="5"/>
</svg>

Before

Width:  |  Height:  |  Size: 228 B

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" version="1.1">
<path d="M 300. 100 h-50-1.5E+2
l100.00000,2000.0E-01 z" fill="red" />
</svg>

Before

Width:  |  Height:  |  Size: 222 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1781 1142">
<path d="m 0,0 l 2.e-4,0 z"/>
</svg>

Before

Width:  |  Height:  |  Size: 159 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="5 0 3 3">
<path stroke="blue" stroke-width="0.01" fill="none" d="M5.81,0 H5.91000" />
</svg>

Before

Width:  |  Height:  |  Size: 199 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<path d="M300.0000, -100.1 z" fill="red" />
</svg>

Before

Width:  |  Height:  |  Size: 163 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="5 0 3 3">
<path d="M10000,0" />
</svg>

Before

Width:  |  Height:  |  Size: 145 B

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<path id="none" d="m0 0 0 0"/>
<path id="attr_butt" d="m0 0 0 0" stroke-linecap="butt"/>
<path id="attr_round" d="m0 0 0 0" stroke-linecap="round"/>
<path id="attr_square" d="m0 0 0 0" stroke-linecap="square"/>
<path id="style_butt" d="m0 0 0 0" style="stroke-linecap:butt"/>
<path id="style_round" d="m0 0 0 0" style="stroke-linecap:round"/>
<path id="style_square" d="m0 0 0 0" style="stroke-linecap:square"/>
</svg>

Before

Width:  |  Height:  |  Size: 522 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<path fill="none" stroke="#000" d="M10,10h100v100h-100z"/>
</svg>

Before

Width:  |  Height:  |  Size: 162 B

View file

@ -1,4 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<svg xmlns="http://www.w3.org/2000/svg">
<polygon points="-100,-100,100-100,100-100-100,-100-100,200" />
</svg>

Before

Width:  |  Height:  |  Size: 156 B

View file

@ -1,4 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<svg xmlns="http://www.w3.org/2000/svg">
<polygon points="100,-100,100-100,100-100-100,-100-100,200" />
</svg>

Before

Width:  |  Height:  |  Size: 155 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<polygon fill="blue" points="10000,50" />
</svg>

Before

Width:  |  Height:  |  Size: 146 B

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<polygon fill="blue" points="50,50 150,50 150,150 50,150 +5e1,500.00e-1" />
<polygon fill="green" points="200,50 300,50 300,150 200,150" />
</svg>

Before

Width:  |  Height:  |  Size: 245 B

View file

@ -1,4 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<svg xmlns="http://www.w3.org/2000/svg">
<polyline points="-100,-100,100-100,100-100-100,-100-100,200" />
</svg>

Before

Width:  |  Height:  |  Size: 157 B

View file

@ -1,4 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<svg xmlns="http://www.w3.org/2000/svg">
<polyline points="100,-100,100-100,100-100-100,-100-100,200" />
</svg>

Before

Width:  |  Height:  |  Size: 156 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<polyline fill="blue" points="10000,50" />
</svg>

Before

Width:  |  Height:  |  Size: 147 B

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path id="path1" d="m1,1z"/>
<path id="path2" d="m1,1z"/>
<path id="path3" d="m1,1z"/>
<path id="path4" d="m1,1z"/>
<path id="p:mypath1" d="m1,1z"/>
<path id="p_mypath1" d="m1,1z"/>
<path id="otherpath" d="m1,1z"/>
<use xlink:href="#path1"/>
</svg>

Before

Width:  |  Height:  |  Size: 403 B

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="0">
<stop offset="0" stop-color="#0F0" />
<stop offset="1" stop-color="#00F"/>
</linearGradient>
</defs>
<rect width="100" height="100" fill="url(&quot;#g&quot;)"/>
</svg>

Before

Width:  |  Height:  |  Size: 372 B

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<style>use[id="t"] {font-size: small}</style>
<text id="t" style="font-family:'Times New Roman'"/>
</svg>

Before

Width:  |  Height:  |  Size: 188 B

Some files were not shown because too many files have changed in this diff Show more