Browse Source

Add script to quickly resize image

ApisNecros 2 years ago
parent
commit
1486343ea3
1 changed files with 14 additions and 0 deletions
  1. 14 0
      resize_image

+ 14 - 0
resize_image

@@ -0,0 +1,14 @@
+#!/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