Skip to content

Conversation

@nathanfranke
Copy link

@nathanfranke nathanfranke commented Apr 13, 2025

See also: #61955 (comment)

TODO

  • as bruvzg mentioned, this PR should actually change editor/icons/DefaultProjectIcon.svg, not icon.svg.
  • I am not sure if <dc:date>2017</dc:date> is correct or if Copyright (c) 2017 should be used somewhere.
  • Fix potential CI/CD bug (see below)

Edit: Was a comment (<!-- -->), but now it is SVG metadata.

SVG metadata resources:

CI/CD: Possible SVGO bug

SVGO strips the metadata unless both these overrides are present. However, this incorrectly also whitelists editor metadata like xmlns:inkscape.

diff --git a/misc/utility/svgo.config.mjs b/misc/utility/svgo.config.mjs
index 3849103e2b..10ba9063d5 100644
--- a/misc/utility/svgo.config.mjs
+++ b/misc/utility/svgo.config.mjs
@@ -12,6 +12,8 @@ export default {
                                overrides: {
                                        removeHiddenElems: false,
                                        convertPathData: false,
+                                       removeEditorsNSData: false,
+                                       removeMetadata: false,
                                },
                        },
                },

A possible workaround is using scour or another optimizer.

scour --no-line-breaks icon.svg > _icon.svg && mv _icon.svg icon.svg

In the meantime, I enabled pretty print so the diff is easier to view.

svgo icon.svg --config misc/utility/svgo.config.mjs --pretty

@bruvzg
Copy link
Member

bruvzg commented Apr 13, 2025

It is attributed in the COPYRIGHT.txt, so not sure if there's any point of duplicating it.

But probably makes sense for the default project icon, which is added to user projects.

@nathanfranke nathanfranke changed the title Add copyright attribution to icon.svg Add copyright attribution metadata to icon.svg Apr 13, 2025
@bruvzg
Copy link
Member

bruvzg commented Apr 13, 2025

.pre-commit-config.yaml can have exclude to skip check for a specific file:

        files: \.svg$
        args: [--quiet, --config, misc/utility/svgo.config.mjs]
        additional_dependencies: [svgo@3.3.2]
+        exclude: |
+          (?x)^(
+            editor/icons/DefaultProjectIcon.svg
+          )$

      - id: copyright-headers
        name: copyright-headers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants