From: Mike Frysinger Date: Wed, 14 Feb 2018 05:03:03 +0000 (-0500) Subject: imgcrush: fix png crushing X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=36338394f7de840fcab5d12ba9c6e1c054a4fd90;p=home.git imgcrush: fix png crushing --- diff --git a/.bin/imgcrush b/.bin/imgcrush index 51ba343..854ad4d 100755 --- a/.bin/imgcrush +++ b/.bin/imgcrush @@ -8,13 +8,15 @@ EOF } crush_jpg() { - jpegoptim "$1" + local img="$1" + jpegoptim "${img}" } crush_png() { + local img="$1" # apngopt likes to corrupt images. - pngcrush -e .png.new "$1" - mv "${png}.new" "${png}" + pngcrush -e .png.new "${img}" + mv "${img}.new" "${img}" } crush() { @@ -31,6 +33,7 @@ main() { while [[ $# -ne 0 ]] ; do case $1 in -h) usage ;; + -x) set -x; shift ;; -*) usage 1 ;; *) crush "$1"; shift ;; esac