msfjarvis.dev/scripts/pngtowebp.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
257 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2024-03-31 21:56:49 +05:30
set -euo pipefail
2024-03-31 21:56:49 +05:30
function convert_to_webp() {
local DIR
DIR="${1}"
fd -tf png$ "${DIR:?}" -x cwebp -lossless -mt {} -o '{.}.webp'
fd -tf png$ "${DIR:?}" -X rm -v
}
convert_to_webp static/uploads
convert_to_webp content/posts