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

Window Size Configuration (either default or not) Doesn't Seem to Work #44

Closed
fededamian opened this issue Jan 22, 2020 · 5 comments
Closed

Comments

@fededamian
Copy link

Hello maaaaz, and thanks again for this great tool and the support. Today I am reporting an issue that seems pretty obvious to me, so I don't know if it happens under certain conditions in my environments, although I tested it both on Linux and Mac. Let me know if I can provide more data than the following:

  • Issue: Output screenshots have the content of the whole page, resulting in really long images, even though the default length should be 800 px and also when using the --window-size argument.
  • Tested Version: webscreenshot 2.8 (but it happened with older versions too)
  • Tested OS: Linux and Mac
  • Reproduction steps on Linux: Run the following command and check the output image has more than 360 pixels on length.
python3 webscreenshot.py --no-xserver -r phantomjs -w 1 --window-size 640,360 -o ~ https://www.apple.com/mx/mac/

`**Reproduction steps on Mac ** Run the following command and check the output image has more than 360 pixels on length.

python3 webscreenshot.py --no-xserver -r phantomjs -w 1 --window-size 640,360 -o ~ https://www.apple.com/mx/mac/

Output Image:

https_www apple com_443_mx_mac_

@maaaaz
Copy link
Owner

maaaaz commented Jan 24, 2020

Hello @fededamian,

Thanks your support !

Indeed that bug seems to be trivial:

Could you try with another renderer ?

@fededamian
Copy link
Author

Thanks for the answer @maaaaz ,

Based on the README, I guess the other renderers have bigger issues than this one (no support for sites with invalid certs or no support for concurrency), so I think I'll stick with phantomjs and maybe add some post-processing of the image after I grab it.

@maaaaz
Copy link
Owner

maaaaz commented Jan 24, 2020

Thanks for the answer @maaaaz ,

Based on the README, I guess the other renderers have bigger issues than this one (no support for sites with invalid certs or no support for concurrency), so I think I'll stick with phantomjs and maybe add some post-processing of the image after I grab it.

That is a good idea, I guess you can do it with imagemagick

@fededamian
Copy link
Author

I was able to achieve this goal by using the following imagemagick command (if the output of webscreenshot is a picture with the filename image.png):

convert image.png -crop 640x480+0+0 +repage -background black -extent 640x480+0+0 image.png

Which either crops or enlarges the image to the desired resolution.

@maaaaz
Copy link
Owner

maaaaz commented Aug 16, 2020

Added this issue in FAQ for reference.

@maaaaz maaaaz closed this as completed Aug 16, 2020
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

2 participants