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

Bug error: The image argument is a canvas element with a width or height of 0. when canvas.width or height less than 1 #2981

Open
herbertxy opened this issue Oct 28, 2022 · 1 comment · May be fixed by #2982

Comments

@herbertxy
Copy link

Bug reports:
Failed to execute 'createPattern' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.

image

I console the value of width and height , find that the height is less than 1 caught this error
image
image

Specifications:

  • html2canvas version tested with: 1.4.1
  • Browser & version: chrome latest
  • Operating system: windows 10

solution:
calculateBackgroundRendering function return value width height may be less than 1
and createPattern function throw error

@herbertxy
Copy link
Author

hope to approval #2982

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

Successfully merging a pull request may close this issue.

1 participant