#!/bin/bash #### # See: https://github.com/gdog2u/resize-image-by-percent # Uses GIMP and my own Script-Fu script to quickly resize an image #### test -f "$1" || { echo "Argument 1: '$1' must be a file" 1>&2; exit 1; } test "$2" -gt 0 || { echo "Argument 2: '$2' must be an integer greater than 0" 1>&2; exit 2; } if [ -f "$1" ] then gimp -i -b "(resize-image-by-percent \"$1\" $2)" -b '(gimp-quit 0)' &>/dev/null fi