-
-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
Dear @vgalin,
I have been a very big fan of your html2image package!
In previous versions I did not experience this issue but now I do (I think because of the changes in headless browser?):
When I crop the screenshot to a certain size, the lower part of the screenshot disappears.
Now I have a workaround where I save the full screenshot and then crop to size using PIL (getbbox), but it would be cleaner if this issue would be solved within html2image.
Any solution would be very much appreciated! I am sorry in case I overlooked other issues on this problem.
Reproducible example:
img.svg:
<?xml version="1.0" encoding="utf-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="full" height="420" version="1.1" width="420">
<rect fill="blue" height="420" width="420" x="0" y="0"/>
</svg>
test.py:
from html2image import Html2Image
hti = Html2Image()
_ = hti.screenshot(other_file="img.svg", save_as='img.png')
_ = hti.screenshot(other_file="img.svg", save_as='img_sized.png', size=(420, 420))
Non-cropped gives square of 420x420 with blank space around:
Blue part is not square when cropping to 420x420:
vgalin
Metadata
Metadata
Assignees
Labels
No labels

