Skip to content

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
yorickshan/html2canvas-pro
#12
@herbertxy

Description

@herbertxy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions