Ckeditor5: There's no way to edit SVG files in the project because they are "overcompressed"

Created on 26 Feb 2020  路  8Comments  路  Source: ckeditor/ckeditor5

Provide a description of the task

Check out what link.svg looks like when opened in Sketch:

image

(similar results in other graphic editors).

This is because of our aggressive clean-up-svg-icons task squeezes every byte of the SVG files using every technique available and SVG editors don't handle this well on the input (FYI it looks ok in the browser).

Unless we have these icons stored somewhere locally (or retrieved from the git history) there's no way to edit and improve them. Or copy and use as a base for future icons.

We need to either:

  • find some way to decompress the icons (unlikely to happen),
  • store and maintain a sketch file with icons for everyone to use,
  • store raw (uncompressed) SVG icons somewhere else (in parallel to compressed ones).

cc @panr @dkonopka @Reinmar

uux discussion task

Most helpful comment

Well done! We should call our compressor Picasso ;-D

All 8 comments

Well done! We should call our compressor Picasso ;-D

Looks like the following helps:

diff --git a/scripts/svgo.config.json b/scripts/svgo.config.json
index a5ba4161..dd238555 100644
--- a/scripts/svgo.config.json
+++ b/scripts/svgo.config.json
@@ -3,8 +3,9 @@
                   "collapseGroups",
                   "removeDimensions",
                   { "removeAttrs": { "attrs": "(fill|stroke|fill-rule)" } },
+                  { "convertPathData": { "noSpaceAfterFlags": false } },
                   "removeTitle",
                   "removeComments",
                   "removeMetadata"
          ]
-}
\ No newline at end of file
+}

I can confirm. Fix works fine! 馃帀 (tested locally)

I created a PR. It solves the technical aspect and brings mangled icons back to life but we may not be that lucky next time. Let's discuss the way we store, share and develop editor resources like Sketch files.

Re-opening because of

Let's discuss the way we store, share and develop editor resources like Sketch files.

Are you sure? This is a good followup to the issue. I would close it and open a new one.

Alright, please a new one and put some reference to this one.

Was this page helpful?
0 / 5 - 0 ratings