resize_image 421 B

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