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

Generated image dimensions differ from defined one #177

Open
preske87 opened this issue Jan 30, 2025 · 2 comments
Open

Generated image dimensions differ from defined one #177

preske87 opened this issue Jan 30, 2025 · 2 comments

Comments

@preske87
Copy link

preske87 commented Jan 30, 2025

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.

@ahmedsafadii
Copy link

same issue.

@fatihak
Copy link

fatihak commented Feb 24, 2025

Same issue here, seems related to the chrome/chromium screenshot command since it also happens when i take a screenshot from the command line

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

No branches or pull requests

3 participants