vgalin / html2image

A package acting as a wrapper around the headless mode of existing web browsers to generate images from URLs and from HTML+CSS strings or files.
MIT License
344 stars 44 forks source link

Black border rendered with an image #111

Open megaprimatus opened 1 year ago

megaprimatus commented 1 year ago

Hi, For some reason the black border is now rendered with an image. I have a standard setup without any extra CSS styles. In addition the size is always rendered with 800x600px regardless my settings.

hti = Html2Image()
hti.output_path = path
hti.screenshot(html_file=path + '/plot.html', save_as='plot.png', size=(720, 800))

Murthy582 commented 1 year ago

@ser-zhm We ran into the same issue. Were you able to resolve it?

megaprimatus commented 1 year ago

@ser-zhm We ran into the same issue. Were you able to resolve it?

No unfortunately not

vgalin commented 1 year ago

Could you provide a reproducible example ? By providing the HTML file you're using for example. Also the issue regarding the size of the generated image could be related to a bug on a recent Chrome version, updating Chrome may at least resolve the size issue.

kzu commented 1 year ago

html2image --html "test.svg" --save "test.png" -v --size 38,38

SVG (unchanged from before): test

Black background now: test

Previously (have lost track of exactly when this started to fail): image

(source repo where I'm doing this, with full history: https://github.com/devlooped/sponsors/tree/main/.github/avatars)

html2image version: 2.0.3 windows 11, ms edge Version 115.0.1901.188 (Official build) (64-bit) chrome: Versión 115.0.5790.110 (Build oficial) (64 bits)

I hope this helps!