-
Notifications
You must be signed in to change notification settings - Fork 942
feat: add default screenshot format configuration and update readme.md docs #591
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
feat: add default screenshot format configuration and update readme.md docs #591
Conversation
|
By the way, I am testing this fix locally while working on my projects and the claude.md instructions are not really followed all the time. The most reliable way is to add the settings into the ~/.claude.json as defined in the Readme.md of this fix. |
README.md
Outdated
| > PNG is the default format as it provides lossless screenshots. JPEG typically produces smaller file sizes than PNG, which improves performance when working with screenshots. WebP offers the best compression while maintaining quality. | ||
| > [!NOTE] | ||
| > **Claude Code users**: If you experience issues with screenshots not displaying correctly, you can work around this by: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this into troubleshooting.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
README.md
Outdated
|
|
||
| ### Configuring default screenshot format | ||
|
|
||
| You can set a default image format for all screenshots using the `--screenshot-format` option. The default is PNG. You can change it to JPEG or WebP if needed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need an explicit example in the readme, let's remove it and rely on the CLI docs and --help examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/cli.ts
Outdated
| screenshotFormat: { | ||
| type: 'string', | ||
| describe: | ||
| 'Default image format for screenshots. Options: png, jpeg, webp. Default is png.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's clarify that this is for screenshots taken by take_screenshot if no format is supplied to the tool call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
Please update the PR description as it does not sounds correct. |
| } | ||
|
|
||
| const format = request.params.format; | ||
| const quality = format === 'png' ? undefined : request.params.quality; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert removal of this logic.
Description
Fixes #583
This PR adds a
--screenshot-formatconfiguration option that allows users to set a default image format (png, jpeg, or webp) for thetake_screenshottool when no explicit format parameter is provided.This is particularly useful for Claude Code users who experience issues with PNG screenshots not displaying correctly - they can now configure JPEG as the default format server-wide instead of having to specify it in every screenshot call.
Changes
--screenshot-formatCLI option with choices: png, jpeg, webp (default: png)take_screenshottool to use the configured default format when no format parameter is provided