Skip to content

Generated image dimensions differ from defined one #177

@preske87

Description

@preske87

I am generating an image using the following

    generated_files = hti.screenshot(url=html_file, save_as=screenshot_filename, size=((IMG_WIDTH,IMG_HEIGHT)))

IMG_WIDTH is set to 1080
IMG_HEIGHT is set to 1920

When I open the html_file in browser, setting size to the above, all is displayed fine

Image

But the generated image does not match this

Image

Also the dimensions of the generated image are double of what I defined, they are 2160x3840.

The visble green bar at the bottom is the body's background color from css in the html file

body {
                background-color: green;
                width: 100vw;
                min-height: 100vh; 
            }

So something is truncating the actual content of the div containing the background.

I also tried setting the image as background for the body

body {
                /*background-color: green;*/
                background-image: url("../template/wallpaper_ausblick_1080x1920.jpg");
                background-repeat: no-repeat;
                background-attachment: fixed;
                background-size: cover;
                width: 100vw;
                min-height: 100vh; 
            }

But even then the green bar remains. It appears something is "reserving" some space at the bottom and prevents the background image being displayed in there.

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