2017-09-21 20:28:15 +03:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
|
|
for f in *.svg; do
|
|
|
|
svgo --multipass -q "$f" &
|
|
|
|
done
|
|
|
|
|
|
|
|
for f in *.png; do
|
|
|
|
TMPNAME=.$f.tmp
|
|
|
|
(pngcrush -q "$f" "$TMPNAME" && mv -f "$TMPNAME" "$f") &
|
|
|
|
done
|
|
|
|
|
2017-10-25 21:08:27 +03:00
|
|
|
pushd sample >/dev/null
|
|
|
|
for f in *.png; do
|
|
|
|
TMPNAME=.$f.tmp
|
|
|
|
if (echo "$f" | grep -q 'thumb'); then
|
|
|
|
(convert "$f" -flatten -background white -colors 16 "$TMPNAME" && pngcrush -q "$TMPNAME" "$f") &
|
|
|
|
else
|
|
|
|
(pngcrush -q "$f" "$TMPNAME" && mv -f "$TMPNAME" "$f") &
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
popd >/dev/null
|
|
|
|
|
2017-09-21 20:28:15 +03:00
|
|
|
wait
|