-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbatch_conversion_ffc.sh
More file actions
executable file
·44 lines (40 loc) · 1.45 KB
/
Copy pathbatch_conversion_ffc.sh
File metadata and controls
executable file
·44 lines (40 loc) · 1.45 KB
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
# This file is part of Negative Inversion Processor.
#
# Negative Inversion Processor is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Negative Inversion Processor is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Negative Inversion Processor. If not, see <https://www.gnu.org/licenses/>.
# example of how to perform batch conversions using the CLI utility
# $1 is directory
# $2 is raw file extension (NEF, for example)
# $3 is output directory
# $4 is ffc image
# $5 is preset
# $6 is location of neg_inverter project
WORK_DIR="."
if [ -n "$6" ]; then
WORK_DIR="$6"
fi
for item in "$1"/*."$2"; do
if [ "$4" != "basename $item" ]; then
python3 "$WORK_DIR/inverter/inverter.py" \
-p "$WORK_DIR/icc_profiles/Rec2020-elle-V4-g10.icc" \
--preset "$5" \
--crop-inset 0.91 \
--ffc "$4" \
"$item" \
"$3/$(basename "$item" ".$2").tiff"
else
# this clause simply don't work
echo "Skipping FFC source file."
fi
done