File: optimizeImage.sh

package info (click to toggle)
budgie-backgrounds 3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,944 kB
  • sloc: sh: 20; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 325 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

INPUT="$1"
OUTPUT="$2"

cp "$INPUT" "$OUTPUT" || exit 1

mogrify -format jpg "$OUTPUT" || exit 2
mogrify -resize 3840x2160^ "$OUTPUT" || exit 3

QUALITY=$(identify -format %Q  $OUTPUT) 

if [ $QUALITY -gt 90 ]; then
    mogrify -quality 90 "$OUTPUT" || exit 4
fi

jhead -autorot -de -di -du -c "$OUTPUT" || exit 5