blob: ec7a20db6ef8091fc9fca2481c4a17bc0eedacf2 (
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/bin/sh
if [ -z "$3" ]; then
echo "Usage: imgres <option> <input> <output>"
echo "Available options: recipe, wallpaper, thumbnail"
exit
fi
option="$1"
input="$2"
output="$3"
case "$option" in
recipe)
convert "$input" \
-strip \
-interlace plane \
-define jpeg:dct-method=float \
-sampling-factor 4:2:0 \
-resize 1200x800 \
-quality 80 \
"$output"
;;
photo)
convert "$input" \
-strip \
-interlace plane \
-define jpeg:dct-method=float \
-sampling-factor 4:2:0 \
-resize 1600x900 \
-quality 80 \
"$output"
;;
wallpaper)
convert "$input" -resize 2560x1440^ -quality 90 "$output"
;;
thumbnail)
convert "$input" -strip -interlace plane -resize 400x270 -quality 75 "$output"
;;
*)
echo "Invalid option \"$option\""
exit
;;
esac
|