}
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() {
while [[ $# -ne 0 ]] ; do
case $1 in
-h) usage ;;
+ -x) set -x; shift ;;
-*) usage 1 ;;
*) crush "$1"; shift ;;
esac