From 36338394f7de840fcab5d12ba9c6e1c054a4fd90 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 14 Feb 2018 00:03:03 -0500 Subject: [PATCH] imgcrush: fix png crushing --- .bin/imgcrush | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 -- 2.39.5