forked from edgardoh/darktable
-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathextract_wb_from_images.sh
executable file
·51 lines (40 loc) · 1.46 KB
/
extract_wb_from_images.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
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
#
# Usage: extract_wb_from_images
#
commandline="$0 $*"
# handle command line arguments
option="$1"
if [ "${option}" = "-h" ] || [ "${option}" = "--help" ]; then
echo "Extract White Balance preset info from images"
echo "Usage: $0 <file1> [file2] ..."
echo ""
echo "This tool will generate archive with white balance"
echo "presets extracted from provided image files"
exit 0
fi
tmp_dir=$(mktemp -d -t dt-wb-XXXXXXXXXX)
cur_dir=$(pwd)
tarball="$cur_dir"/ansel-whitebalance-$(date +'%Y%m%d').tar.gz
echo "Extracting WB presets."
for image in "$@"
do
echo -n "."
exiftool -Make -Model "-WBType*" "-WB_*" "-ColorTemp*" \
-WhiteBalance -WhiteBalance2 -WhitePoint -ColorCompensationFilter \
-WBShiftAB -WBShiftAB_GM -WBShiftAB_GM_Precise -WBShiftGM -WBScale \
-WhiteBalanceFineTune -WhiteBalanceComp -WhiteBalanceSetting \
-WhiteBalanceBracket -WhiteBalanceBias -WBMode -WhiteBalanceMode \
-WhiteBalanceTemperature -WhiteBalanceDetected -ColorTemperature \
-WBShiftIntelligentAuto -WBShiftCreativeControl -WhiteBalanceSetup \
-WBRedLevel -WBBlueLevel -WBGreenLevel -RedBalance -BlueBalance \
"${image}" > "${tmp_dir}/${image}.txt"
done
echo
echo "preparing tarball..."
tar -czf "${tarball}" -C ${tmp_dir} .
echo "cleaning up..."
rm -rf $tmp_dir
echo
echo "Extracting wb presets done, post the following file to us:"
echo $tarball