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

Support saving screenshots as WebP files #6263

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

absidue
Copy link
Member

@absidue absidue commented Dec 2, 2024

Support saving screenshots as WebP files

Pull Request Type

  • Feature Implementation

Related issue

Description

This pull request adds support for saving screenshots as WebP files. The other two requested formats are not possible as explained in my comment on that feature request (TL;DR Chromium doesn't support encoding to AVIF and doesn't support JPEG XL at all, not even displaying them), so I feel like it is appropriate to close it even if we only implement support for saving as WebP files.

Testing

Take some screenshots with the WebP format selected, you can also experiment with the quality setting to see how it affects the file size and visual quality.

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0a67938

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Dec 2, 2024
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) December 2, 2024 21:56
@@ -1488,7 +1488,7 @@ export default defineComponent({

const format = screenshotFormat.value
const mimeType = `image/${format === 'jpg' ? 'jpeg' : format}`
const imageQuality = format === 'jpg' ? screenshotQuality.value / 100 : 1
const imageQuality = format !== 'png' ? screenshotQuality.value / 100 : 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just throw the value into it without checking format?
For png it doesn't change anything

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So replace the ternary with a code comment? We need something there.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just throw screenshotQuality.value / 100 in and maybe with a comment about png format doesn't care about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: waiting for review For PRs that are complete, tested, and ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Add more Screenshot Formats
3 participants