-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.sh
executable file
·40 lines (33 loc) · 728 Bytes
/
util.sh
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
#! bin/bash
BACKUP_DIR=.bak
backup_file () {
mkdir -p .bak
cp $1 .bak
}
scale () {
# scale images down to 1080px wide
for f in $@; do
backup_file $f;
ffmpeg -y -i "$f" -q:v 1 -vf scale=-1:1080 "${f%.jpg}.jpg";
done
}
process-image () {
# process images without scaling them. This usually reduces the file size
# quite significantly from the right-off-the-phone version.
for f in $@; do
backup_file $f;
ffmpeg -y -i "$f" "${f%.jpg}.jpg";
done
}
rotate_clock () {
for f in $@; do
backup_file $f;
ffmpeg -i "$f" -vf "transpose=clock" -y "$f";
done
}
rotate_cclock () {
for f in $@; do
backup_file $f;
ffmpeg -i "$f" -vf "transpose=2" -y "$f";
done
}