[BUG] A png screenshot is produced when a jpeg/jpg screenshot is requested
See original GitHub issueContext:
- Playwright Version: 1.4.2 and 1.5.1
- Operating System: macOS, Linux
- Node.js version: 14.1.0
- Browser: All
- Extra: (None)
Code Snippet
(async () => {
for (const browserType of ['chromium', 'firefox', 'webkit']) {
const browser = await playwright[browserType].launch();
const context = await browser.newContext();
const page = await context.newPage();
await page.goto('http://whatsmyuseragent.org/');
//await page.screenshot({ path: `example-${browserType}.png` }); //Generates .png screenshots
await page.screenshot({ path: `example-${browserType}.png`, type: "jpeg" }); //Also generates .png screenshots
await browser.close();
}
})();
Describe the bug
Providing type: "jpeg"
in page.screenshot()
's options
parameter has no effect. I initially noticed this problem on 1.4.2. After upgrading to 1.5.1, I’m still seeing the same behavior. All generated screenshots are of type png.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Unable to attach/upload screenshot when reporting a bug
Attaching/uploading an image when reporting a bug results in the following errors: Upload failed: Failed to send request to ...
Read more >How to Take JPEG Screenshots Instead of PNG ...
1. Crop the Photo to Get It in JPEG Format. The simplest way to turn a screenshot into a JPEG image is to...
Read more >How to save screenshots as JPG automatically?
navigate to org > gnome > gnome-screenshot and change the default-file-type png to jpg. Share.
Read more >Take screenshot of Web site and save it to png/jpg/bmp/tiff ...
SiteShoter is a small utility that allows you to save a screenshot of any Web page into a file.
Read more >Video Screenshot in jpg distorted (#13862) · Issues
action: set video screenshot format to jpg in -settings -video -screenshots ... Something went wrong while fetching related merge requests.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for confirming. I believe there are 2 action items:
path
takes precedence overtype
.path
does not have an extension, buttype
is specified.Hi Rich!
Thanks for the reply, although I figured it out with trial and error. Thank you so much for taking time to reply. And I’ll create a separate ticket if I encounter a problem.
Thanks!
On Tue, Jan 12, 2021 at 12:58 AM Rich Christiansen notifications@github.com wrote: