Created
November 23, 2020 16:13
-
-
Save danim47c/222ea46fceaebd2bf8d3d08b4f36b5db to your computer and use it in GitHub Desktop.
A command that converts all jpg and png images in a folder and subfolders into .webp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ./ -type f -name '*.jpg' -exec sh -c 'cwebp -q 100 $1 -o "${1%.jpg}.webp"' _ {} \; && find ./ -type f -name '*.png' -exec sh -c 'cwebp -q 100 $1 -o "${1%.png}.webp"' _ {} \; && rm */**/*.jpg && rm */**/*.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment