S
S
Stanislav2018-11-01 21:40:56
Node.js
Stanislav, 2018-11-01 21:40:56

How to overlay SVG on a photo with your own styles in sharp?

Faced a problem.
I'm using https://github.com/lovell/sharp
I'm trying to overlay this SVG on a photo https://jsfiddle.net/sfqodngw/

return sharp(tmp)
        .resize(1000, 600)
        .overlayWith(path.resolve(__dirname, 'static/images/logo.svg'))
        .toFile(file)
        .then()

Crashes in console
librsvg-Message: 21:22:16.562: CSS unrecoverable error
Fontconfig warning: "/etc/fonts/fonts.conf", line 160: blank doesn't take any effect anymore. please remove it from your fonts.conf

Can't pick up styles and fonts, is there a way to win? Or do I need to convert svg to png? I tried online editors, but they don't pick up styles either.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question