svg / svgo

⚙️ Node.js tool for optimizing SVG files
https://svgo.dev/
MIT License
20.99k stars 1.39k forks source link

Filters in use are removed #1690

Open zefir-git opened 2 years ago

zefir-git commented 2 years ago

Describe the bug Blur filter is removed when optimising the SVG with SVGO in certain situations.

To Reproduce Steps to reproduce the behavior:

  1. Draw a polygon
  2. Apply linear gradient to fill
  3. Apply gaussian blur filter to polygon
  4. Optimise with SVGO

Expected behavior The filter should not be removed as it is in use.

Screenshots

Original SVG

test-blur

```svg ```

Optimised SVG

test-blur-optimised

```svg ```

Desktop (please complete the following information):

Additional context Can also be reproduced using https://jakearchibald.github.io/svgomg/

johnkenny54 commented 2 months ago

This appears to work OK in 3.3.2.

zefir-git commented 2 months ago

I can confirm this works correctly using svgo 3.3.2 and the SVG I shared above in the expected behaviour.

Can this issue be linked to a pull request or a commit?

johnkenny54 commented 2 months ago

I don't know, a lot has changed since 2.8, this was presumably related to one of the many bug fixes since then.

zefir-git commented 2 months ago

I don't know, a lot has changed since 2.8, this was presumably related to one of the many bug fixes since then.

https://jakearchibald.github.io/svgomg/ shows v3.0.0 and the issue appears to be present there. Only asking for this in case people find this issue in the future or perhaps if the problem is repeated due to some regression (not familiar with the project and whats tests are performed). If you don't think a reference is needed, feel free to close.