You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #66 Norm and I hashed out a possible spec for a new way of specifying output images on the command line. To quote it:
name: (has to be first) the filename for the image. We possibly allow %s (sanitized url) %x (md5 sum) etc. Or we expect people to provide their own filenames when they are capturing multiple pages. If there are no other options and the name does not start with a number then the : is optional. Likewise the .png on the end is optional if the name does not contain a ..
W - initial browser width in pixels, defaults to 1024
H - initial browser height in pixels, defaults to 768
Z - initial browser zoom, defaults to 1
w - actual output image width, cropping or empty pixels if needed, defaults to the final width of the content multiplied by the resize factor (that is, defaults to the whole image)
h - actual output image height, cropping or empty pixels if needed, defaults to the final height of the content multiplied by the resize factor
x - image resize factor (as in "0.5x size"), defaults to 1 unless an actual width and height are provided, in which case we use the largest scale that will fill the output image.
Some examples:
# full size screenshot, called full.png
webkit2png full https://www.gov.uk
# crop screenshot to 800x600, do not resize:
webkit2png cropped:800w600h https://www.gov.uk/
# resize to quarter size then crop to 200x150:
webkit2png resized:200w150h0.25x https://www.gov.uk/
# iphone screenshot, at full size, output as iphone.png
webkit2png iphone:640W1136H https://www.gov.uk
# as above, but output as wwwgovuk-640W1136H.png
webkit2png 640W1136H https://www.gov.uk
# 320, 640 and 1024 width, full page height
webkit2png 320W 640W 1024W https://www.gov.uk
# 1000 width and 200x150 thumbnail grabs, output: full.png, thumb.png
webkit2png full:1000W thumb:1000W200w150h https://www.gov.uk
We're not going to land that PR so I'm opening an issue instead. And looking back at that spec now I'm not sure I agree with the details so maybe we can change them.
The text was updated successfully, but these errors were encountered:
In #66 Norm and I hashed out a possible spec for a new way of specifying output images on the command line. To quote it:
name:
(has to be first) the filename for the image. We possibly allow%s
(sanitized url)%x
(md5 sum) etc. Or we expect people to provide their own filenames when they are capturing multiple pages. If there are no other options and the name does not start with a number then the:
is optional. Likewise the .png on the end is optional if the name does not contain a.
.W
- initial browser width in pixels, defaults to 1024H
- initial browser height in pixels, defaults to 768Z
- initial browser zoom, defaults to 1w
- actual output image width, cropping or empty pixels if needed, defaults to the final width of the content multiplied by the resize factor (that is, defaults to the whole image)h
- actual output image height, cropping or empty pixels if needed, defaults to the final height of the content multiplied by the resize factorx
- image resize factor (as in "0.5x size"), defaults to 1 unless an actual width and height are provided, in which case we use the largest scale that will fill the output image.Some examples:
We're not going to land that PR so I'm opening an issue instead. And looking back at that spec now I'm not sure I agree with the details so maybe we can change them.
The text was updated successfully, but these errors were encountered: