Open linev opened 1 year ago
There's a couple of things that could be the problem.
1) Check that the path to the test1.svg
file is correct. Is this script in the root directory? Along with test1.svg
?
i.e. if the script is in src/script.js
, and test1.svg
is located at src/test1.svg
, then try updating loadImage
to loadImage('src/test1.svg')
and running the script from the src/
directory.
2) Maybe it has something to do with how the browser handles svgs vs node-canvas. That could explain if you're able to load the image in one place but not another. You could try embedding test1.svg
as a data URI, though this sounds kinda ugly.
This is probably a known issue: #1607. @linev could read through that issue and close this if it's a duplicate, please?
@zbjornson
GdkPixbuf
- may be on Linux they handled differently,original issue found on Mac. And proposed solution in #1607 with newline wrapping does not help.
I have SVG which includes
image
elementThis small script should load SVG image and convert into png buffer.
But on png one do not see
image
- at the same time text is thereIs it known problem?
Your Environment