diff options
author | Yaroslav <contact@yaroslavps.com> | 2020-10-07 14:35:19 +0300 |
---|---|---|
committer | Yaroslav <contact@yaroslavps.com> | 2020-10-07 14:35:19 +0300 |
commit | 895fa177e29ec897bfb9c25f117661c42817eb99 (patch) | |
tree | 16fe835a4d0a2f15112623f79c92d05a2e1451a1 /dotfiles | |
parent | e610e63c500b373832e3b4526c4d2ca2bce3b7b9 (diff) | |
download | swayrice-895fa177e29ec897bfb9c25f117661c42817eb99.tar.gz swayrice-895fa177e29ec897bfb9c25f117661c42817eb99.zip |
script to resize/compress images
Diffstat (limited to 'dotfiles')
-rwxr-xr-x | dotfiles/.local/bin/imgres | 28 |
1 files changed, 28 insertions, 0 deletions
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 |