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

Update pangolin
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jan 01 18:26:56 2020 +0100 (3 months ago)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/pkgs/shrink-icons.sh	Wed Jan 01 18:26:56 2020 +0100
     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"