kobel/assets/build/images.sh

20 lines
322 B
Bash
Raw Normal View History

2024-01-11 20:04:55 +00:00
#!/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
2024-01-11 20:08:31 +00:00
convert $PARAMS "$FILE" "${FILE}".webp;
convert $PARAMS "$FILE" "${FILE}".avif;
2024-01-11 20:04:55 +00:00
done