Be smart about thumbnailing and uploading benches
This commit is contained in:
19
bench.sh
19
bench.sh
@@ -4,14 +4,17 @@ set -e
|
||||
set +x
|
||||
|
||||
for FILE in img/bench/webp-src/*.jpg; do
|
||||
OUT="${FILE%.*}.webp"
|
||||
OUT2X="${FILE%.*}@2x.webp"
|
||||
if [ ! -f ../$OUT ]; then
|
||||
cwebp -mt -resize 160 0 -q 40 $FILE -o $OUT
|
||||
FULLNAME=$(basename -- ${FILE})
|
||||
NAME=${FULLNAME%.*}
|
||||
OUT="img/bench/${NAME}.webp"
|
||||
OUT2X="img/bench/${NAME}@2x.webp"
|
||||
echo "Checking for \"${OUT}\"..."
|
||||
if [ ! -f "${OUT}" ]; then
|
||||
echo "Would thumbnail ${OUT}"
|
||||
cwebp -mt -resize 160 0 -q 40 ${FILE} -o ${OUT}
|
||||
fi
|
||||
if [ ! -f ../$OUT2X ]; then
|
||||
cwebp -mt -q 40 $FILE -o $OUT2X
|
||||
if [ ! -f "${OUT2X}" ]; then
|
||||
echo "Would thumbnail@2x ${OUT2X}"
|
||||
cwebp -mt -q 40 ${FILE} -o ${OUT2X}
|
||||
fi
|
||||
done
|
||||
|
||||
mv img/bench/webp-src/*.webp img/bench/
|
||||
|
||||
Reference in New Issue
Block a user