kobel/assets/build/images.sh

20 lines
No EOL
322 B
Bash
Executable file

#!/bin/bash
PARAMS=('-quality 90')
if [ $# -ne 0 ]; then
PARAMS=$@;
fi
cd $(pwd)
shopt -s nullglob nocaseglob extglob
shopt -s globstar
# Resize
# Web Optimized Formats
for FILE in static/**/*.@(jpg|jpeg|tif|tiff|png); do
convert $PARAMS "$FILE" "${FILE}".webp;
convert $PARAMS "$FILE" "${FILE}".avif;
done