2023-06-07 13:40:41 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
if [ $# -eq 0 ]; then echo "Geef bestandsnaam op zonder extensie. michael-boelen.jpg --> michael-boelen"; exit 1; fi
|
|
|
|
|
|
|
|
if [ -f "$1.png" ]; then
|
|
|
|
# 150
|
|
|
|
convert "$1.png" -resize 150x150 "$1-150x150.png"
|
2023-06-23 11:39:11 +02:00
|
|
|
cwebp -q 80 -m 6 -preset photo -sharp_yuv "$1-150x150.png" -o "$1-150x150.webp"
|
2023-06-07 13:40:41 +02:00
|
|
|
optipng -o7 "$1-150x150.png"
|
|
|
|
# 200
|
|
|
|
convert "$1.png" -resize 200x200 "$1-200x200.png"
|
2023-06-23 11:39:11 +02:00
|
|
|
cwebp -q 80 -m 6 -preset photo -sharp_yuv "$1-200x200.png" -o "$1-200x200.webp"
|
2023-06-07 13:40:41 +02:00
|
|
|
optipng -o7 "$1-200x200.png"
|
|
|
|
elif [ -f "$1.jpg" ]; then
|
|
|
|
# 150
|
|
|
|
convert "$1.jpg" -resize 150x150 "$1-150x150.jpg"
|
2023-06-23 11:39:11 +02:00
|
|
|
cwebp -q 80 -m 6 -preset photo -sharp_yuv "$1-150x150.jpg" -o "$1-150x150.webp"
|
2023-06-17 16:29:09 +02:00
|
|
|
jpegoptim -m100 "$1-150x150.jpg"
|
2023-06-07 13:40:41 +02:00
|
|
|
# 200
|
|
|
|
convert "$1.jpg" -resize 200x200 "$1-200x200.jpg"
|
2023-06-23 11:39:11 +02:00
|
|
|
cwebp -q 80 -m 6 -preset photo -sharp_yuv "$1-200x200.jpg" -o "$1-200x200.webp"
|
2023-06-07 13:40:41 +02:00
|
|
|
jpegoptim -m100 "$1-200x200.jpg"
|
|
|
|
else
|
2023-06-08 13:31:33 +02:00
|
|
|
echo "Bestand niet gevonden. Geef bestand op zonder extensie."
|
2023-06-07 13:40:41 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# EOF
|