kobel/assets/build/images.sh

20 lines
320 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
magick $PARAMS "$FILE" "${FILE}".webp;
magick $PARAMS "$FILE" "${FILE}".avif;
done