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

SVG Support Required even for png and webp #256

Open
henrymcl opened this issue Nov 1, 2024 · 2 comments
Open

SVG Support Required even for png and webp #256

henrymcl opened this issue Nov 1, 2024 · 2 comments

Comments

@henrymcl
Copy link

henrymcl commented Nov 1, 2024

Thank you for the excellent work.

I'm getting the rawData for my QR code in both png and webp in NodeJS but they result in:

Error: node-canvas was built without SVG support

Info:

  • "canvas": "^2.11.2"
  • "jsdom": "^25.0.1"
  • "qr-code-styling": "^1.8.4"
  • I'm using node-alpine for my project:
FROM node:18-alpine3.20
RUN apk update && apk add --no-cache supervisor
RUN apk add --no-cache build-base g++ cairo-dev pango-dev giflib-dev librsvg

I have also been trying techniques like npm install canvas --build-from-source to no avail.

Meanwhile I'll try to see if it can be done client-side.

@HachimanHiki
Copy link

HachimanHiki commented Nov 30, 2024

Hi there,

I’m also using node-alpine image, and I’ve been able to use getRawData without encountering the SVG support error.

The dependencies I installed are as follows:

RUN apk add --no-cache build-base g++ cairo-dev pango-dev jpeg-dev librsvg-dev cairo pango jpeg librsvg

Based on my guess, the error could be related to the absence of librsvg-dev.

Hope this helps!

@kadishmal
Copy link

kadishmal commented Dec 27, 2024

It would be nice to have an option to avoid SVG if type is PNG just like it is possible to build canvas without SVG and other types but PNG.

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

No branches or pull requests

3 participants