slitaz-forge diff pkgs/shrink-icons.sh @ rev 702

Update mirrors list
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sun Oct 27 09:31:53 2019 +0200 (2019-10-27)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/pkgs/shrink-icons.sh	Sun Oct 27 09:31:53 2019 +0200
     1.3 @@ -0,0 +1,14 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +IFS=$'\n'
     1.7 +
     1.8 +old_size=$(find . -type f -name '*.png' -exec ls -l \{\} \; | awk '{sum += $5}END{print sum}')
     1.9 +
    1.10 +for png in $(find . -type f -name '*.png'); do
    1.11 +	pngquant --speed 1 --skip-if-larger --ext .png --force "$png"
    1.12 +	optipng -strip all -o7 -zm1-9 "$png"
    1.13 +done
    1.14 +
    1.15 +new_size=$(find . -type f -name '*.png' -exec ls -l \{\} \; | awk '{sum += $5}END{print sum}')
    1.16 +
    1.17 +echo "Finished: $old_size -> $new_size"