maaaaz / webscreenshot

A simple script to screenshot a list of websites
GNU Lesser General Public License v3.0
657 stars 164 forks source link

Add crop option #42

Closed manuelbua closed 4 years ago

manuelbua commented 4 years ago

In the past i thought to have submitted an option for this, but i actually pushed an always-cropping version that wouldn't be good for anyone.

This version is an option where no crop is performed by default, but if the option is specified then:

maaaaz commented 4 years ago

Thanks @manuelbua, I can't really figure the use cases for such option, but:

Cheers.

manuelbua commented 4 years ago

Yeah, my use case is possibly a bit different but i often don't need the whole page as i just need a glimpse of it, but thumbnails are unusable for sites that renders at 1200x43000.

I also thought about a --crop parameter to specify the whole rect as an option but wasn't too sure about it, even in my case i've yet to encounter the need for horizontal cropping or x,y tweaking.

maaaaz commented 4 years ago

Ok, I think that I will rather propose a general --crop option allowing to specify the whole rectangle.

manuelbua commented 4 years ago

Oh it's me me messing with the title, sorry for littering the place 😝

I just pushed a revision supporting a rectangle definition: also w and h can be used as to specify the same size as the screen capture.

Only i'm not sure of the way the user is showed an error in case a rectangle is malformed: raising an exception will cause a traceback by default, should we silently fail to the default rect instead?

maaaaz commented 4 years ago

Thanks, --crop option added in v2.8.

Oh it's me me messing with the title, sorry for littering the place 😝

I just pushed a revision supporting a rectangle definition: also w and h can be used as to specify the same size as the screen capture.

Only i'm not sure of the way the user is showed an error in case a rectangle is malformed: raising an exception will cause a traceback by default, should we silently fail to the default rect instead?

I expect people using this option to know what they are doing, so there's just a global fail if one component (top, left, width, height) is missing from the splitted value.