aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/imgres
blob: c2f272f714bc9030559bcd1153c16c4a3e5bce71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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