Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SVG support #53

Closed
haydenbleasel opened this issue Nov 10, 2015 · 17 comments
Closed

Add SVG support #53

haydenbleasel opened this issue Nov 10, 2015 · 17 comments

Comments

@haydenbleasel
Copy link
Contributor

SVG support can be easily implemented if we find a pure-JS Node library that handles SVG to PNG conversion with no external dependencies.

@cloud-walker
Copy link

What about librsvg?

@haydenbleasel
Copy link
Contributor Author

@cloud-walker It relies on the librsvg package from Brew / Yum / Apt-Get. The solution needs to be 100% JS. Good find though, probably the closest solution thus far.

@haydenbleasel
Copy link
Contributor Author

No luck so far :(

@langri-sha
Copy link

Would installing optional (native) dependencies be acceptable?

@haydenbleasel
Copy link
Contributor Author

@langri-sha possibly, what do you have in mind?

@langri-sha
Copy link

Well, 2gis/node-rsvg seems to hit home pretty close, in the here and now. Would it be acceptable to add it as a optional dependency and perform a runtime check when a SVG asset is provided?

I'm just assuming there is a sizable portion of users which already have their logo vectors provided in SVG, who are then exporting a PNG to be able to use the package and if perhaps compromising with an optional dependency might be permissive.

@haydenbleasel
Copy link
Contributor Author

@langri-sha I love the look of that module but it definitely requires the native deps. I want to compromise but Google's planning on using this for WSK and their main issue was with native deps. Plus, I'm aiming for a pure JS build system hence the switch to Jimp.

@haydenbleasel
Copy link
Contributor Author

Documented in the README for now, we'll come back to this when possible.

@haydenbleasel
Copy link
Contributor Author

Update: If you're using Gulp, you can pipe from svg2png for now.

@strarsis
Copy link

Why is a pure JavaScript solution for SVG rendering required?
Isn't this a build tool and usually run on nodejs (with bindings)?

@stavarengo
Copy link

Weird thing, in my machine Ubuntu 15.10 with Node 6.6.0 e npm 3.10.3 it works when I use an SVG image.
But, at my server machine (in the cloud) it does not work. The server machine is a Ubuntu 14.04 with Node 6.6.0 and npm 3.10.3.

The only diff between these machines is the Ubuntu version.
You guys have any ideia why this happens?

@strarsis
Copy link

strarsis commented Apr 26, 2017

@haydenbleasel: Native JavaScript SVG solution, seems also be usable with nodejs (server side): https://github.com/canvg/canvg - so this would finally be possible 😄 .

@Hypnosphi
Copy link

@strarsis you would need node-canvas for that, which uses native package cairo

@Hypnosphi
Copy link

What about sharp?

Most modern 64-bit OS X, Windows and Linux (glibc) systems running Node versions 4, 6, 8 and 10 do not require any additional install or runtime dependencies.

@rommelmamedov
Copy link

What about this? https://github.com/neocotic/convert-svg

@YoshiWalsh
Copy link

@Hypnosphi It appears that as of #221 Sharp is now used.

@ecstrema
Copy link

So if sharp is now used, what is the status of

Why are you missing certain favicons?

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

No branches or pull requests

9 participants