From 895fa177e29ec897bfb9c25f117661c42817eb99 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Wed, 7 Oct 2020 14:35:19 +0300 Subject: script to resize/compress images --- dotfiles/.local/bin/imgres | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 dotfiles/.local/bin/imgres (limited to 'dotfiles') diff --git a/dotfiles/.local/bin/imgres b/dotfiles/.local/bin/imgres new file mode 100755 index 0000000..c2f272f --- /dev/null +++ b/dotfiles/.local/bin/imgres @@ -0,0 +1,28 @@ +#!/bin/sh + +if [ -z "$3" ]; then + echo "Usage: imgres option input output" + exit +fi + +option="$1" +input="$2" +output="$3" + +case "$option" in + recipe) + convert "$input" -resize 1200x800 -quality 85 "$output" + exiftool -overwrite_original -all= "$output" + ;; + wallpaper) + convert "$input" -resize 2560x1440^ -quality 90 "$output" + ;; + thumbnail) + convert "$input" -resize 400x270 -quality 80 "$output" + exiftool -overwrite_original -all= "$output" + ;; + *) + echo "Invalid option \"$option\"" + exit + ;; +esac -- cgit v1.2.3