Skip to content

Commit

Permalink
Support saving screenshots as WebP files (FreeTubeApp#6263)
Browse files Browse the repository at this point in the history
* Support saving screenshots as WebP files

* Simplify screenshot quality handling
  • Loading branch information
absidue authored and Alban Dumas committed Jan 24, 2025
1 parent 261ffad commit a768f8d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,8 @@ export default defineComponent({

const format = screenshotFormat.value
const mimeType = `image/${format === 'jpg' ? 'jpeg' : format}`
const imageQuality = format === 'jpg' ? screenshotQuality.value / 100 : 1
// imageQuality is ignored for pngs, so it is still okay to pass the quality value
const imageQuality = screenshotQuality.value / 100

let filename
try {
Expand Down
6 changes: 4 additions & 2 deletions src/renderer/components/player-settings/player-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ export default defineComponent({
],
screenshotFormatNames: [
'PNG',
'JPEG'
'JPEG',
'WebP'
],
screenshotFormatValues: [
'png',
'jpg'
'jpg',
'webp'
],
screenshotFolderPlaceholder: '',
screenshotFilenameExample: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
:max-value="100"
:step="1"
value-extension="%"
:disabled="screenshotFormat !== 'jpg'"
:disabled="screenshotFormat === 'png'"
@change="updateScreenshotQuality"
/>
</ft-flex-box>
Expand Down

0 comments on commit a768f8d

Please sign in to comment.