You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a SVG file containing "arcto" commands ('a' or 'A') is optimised, setting the plugin parameter "noSpaceAfterFlags" to true for relevant plugins does not result in "unnecessary" spaces (required for some programs) being removed from "arcto" commands in the output file. If these spaces do not exist in the input file, they will additionally be added to the output file, which is the opposite of the expected behaviour of noSpaceAfterFlags.
To Reproduce
Steps to reproduce the behavior:
Save this file (adapted from a MDN path example) and change the extension to .SVG, or copy & save this text as a SVG file:
(GitHub doesn't let me upload javascript files either :/)
3. Run SVGO 2.2.0 on the provided SVG file via the command line, using the provided configuration file (--config conf.js).
4. Observe that the file size is now larger, as SVGO added extra spaces to all "arcto" commands.
Expected behavior
I have been attempting to optimise some SVG files for the web. As SVGO 2.2.0 now does not remove spaces in "arcto" commands by default (#1353), I attempted to set the configuration values to what they were previously. I noticed that when I set the parameter noSpaceAfterFlags to true in the relevant plugins, it still did not remove spaces in "arcto" commands. Regardless of what noSpaceAfterFlags was set to, it started adding them to files that did not contain them!
I'm fairly sure that #1387 is actually the cause of this bug: js2path previously called the method cleanupOutData (found in tools.js) to cleanup path data, which had been removing the spaces in "arcto" commands. It looks like the PR removed this call. The new behaviour for "arcto" commands seems to be intentional (as seen here):
Describe the bug
When a SVG file containing "arcto" commands ('a' or 'A') is optimised, setting the plugin parameter "noSpaceAfterFlags" to true for relevant plugins does not result in "unnecessary" spaces (required for some programs) being removed from "arcto" commands in the output file. If these spaces do not exist in the input file, they will additionally be added to the output file, which is the opposite of the expected behaviour of noSpaceAfterFlags.
To Reproduce
Steps to reproduce the behavior:
(GitHub doesn't let me upload SVGs :/)
2. Save this file and change the extension to .JS, or copy & save this text as a javascript file:
(GitHub doesn't let me upload javascript files either :/)
3. Run SVGO 2.2.0 on the provided SVG file via the command line, using the provided configuration file (--config conf.js).
4. Observe that the file size is now larger, as SVGO added extra spaces to all "arcto" commands.
Expected behavior
I have been attempting to optimise some SVG files for the web. As SVGO 2.2.0 now does not remove spaces in "arcto" commands by default (#1353), I attempted to set the configuration values to what they were previously. I noticed that when I set the parameter noSpaceAfterFlags to true in the relevant plugins, it still did not remove spaces in "arcto" commands. Regardless of what noSpaceAfterFlags was set to, it started adding them to files that did not contain them!
I'm fairly sure that #1387 is actually the cause of this bug: js2path previously called the method cleanupOutData (found in tools.js) to cleanup path data, which had been removing the spaces in "arcto" commands. It looks like the PR removed this call. The new behaviour for "arcto" commands seems to be intentional (as seen here):
svgo/lib/path.js
Line 229 in f3a6cf2
but it results in SVGO not respecting noSpaceAfterFlags.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: