Skip to content

Commit

Permalink
add webp to capture formats #1671
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Aug 23, 2023
1 parent 1a64df2 commit 65f0ad7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,14 @@ const App = memo(() => {

const { ensureWritableOutDir, ensureAccessToSourceDir } = useDirectoryAccess({ setCustomOutDir });

const toggleCaptureFormat = useCallback(() => setCaptureFormat(f => (f === 'png' ? 'jpeg' : 'png')), [setCaptureFormat]);
const toggleCaptureFormat = useCallback(() => setCaptureFormat((f) => {
const captureFormats = ['jpeg', 'png', 'webp'];
let index = captureFormats.indexOf(f);
if (index === -1) index = 0;
index += 1;
if (index >= captureFormats.length) index = 0;
return captureFormats[index];
}), [setCaptureFormat]);

const toggleKeyframeCut = useCallback((showMessage) => setKeyframeCut((val) => {
const newVal = !val;
Expand Down

0 comments on commit 65f0ad7

Please sign in to comment.