Giter VIP home page Giter VIP logo

Comments (6)

KTibow avatar KTibow commented on July 28, 2024

Tip: SVGOMG hasn't been updated for a while, and won't be updated until #1943 is merged. https://omfg.svg.beauty/ is slightly more up to date, but it's best to directly use the library/CLI if you can.

Commentary on the issue: This is already done to some degree, but I wouldn't be surprised if it doesn't work in all cases. Want to share an example SVG where it should remove it but doesn't?

from svgo.

atom3001 avatar atom3001 commented on July 28, 2024

Thanks for the quick response @KTibow. Am running omfg via CLI now. Which does remove raster images properly, which is nice. I suppose I need to develop a plugin to add this feature but am pretty green so will be a struggle. Will paste an image with stuff I'd like to clean out. EG Defaults like:
stroke-dasharray="none" stroke-opacity="1"

Styles to attributes gets rid of the above defaults on the last path but misses the initial two. Any help greatly appreciated

RR_v1_trim_1
RR_v1_trim_1_svgofm_1

from svgo.

KTibow avatar KTibow commented on July 28, 2024

It seems the optimization is disabled when the path is linked in a use. I haven't found where this optimization is applied yet so I don't have much to add.

from svgo.

atom3001 avatar atom3001 commented on July 28, 2024

Yes, if I drop the use elements the path styles get cleaned properly. good spot, thanks. So I could cleanup before cloning. Shame to have a fragmented workflow. But writing plug-ins to do a second cleaning pass is beyond me for now. Thanks again for looking

from svgo.

KTibow avatar KTibow commented on July 28, 2024

I checked and the relevant plugin is removeUnknownsAndDefaults, which actually doesn't clean defaults on attributes with an id

from svgo.

atom3001 avatar atom3001 commented on July 28, 2024

Interesting, thanks for digging deeper @KTibow. Still leaves me in the same boat. Perhaps it would be possible to disable that id limitation?

from svgo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.