ADD image optimization script
This commit is contained in:
parent
4ab9bdab6e
commit
0eb768b78a
1 changed files with 20 additions and 0 deletions
20
assets/build/images.sh
Executable file
20
assets/build/images.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/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
|
Loading…
Reference in a new issue