-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgetPictureInfo.sh
executable file
·144 lines (138 loc) · 3.83 KB
/
getPictureInfo.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/bash
# Print Film mode from Fujifim JPG
# Usage :
# $ ./getPictureInfo.sh *.JPG
#
# Thanks to "exiftool -v2 option" you get useful info from tags:
#
# - CustomRendered = 1 - Tag 0xa401 (2 bytes, int16u[1])
# - Saturation = 771 - Tag 0x1003 (2 bytes, int16u[1])
#
# CustomRendered = 1 + Saturation = 768 => B&W
# CustomRendered = 1 + Saturation = 769 => B&W R
# CustomRendered = 1 + Saturation = 770 => B&W Ye
# CustomRendered = 1 + Saturation = 771 => B&W G
# CustomRendered = 1 + Saturation = 784 => Sepia
# CustomRendered = 1 + Saturation = 1280 => Acros
# CustomRendered = 1 + Saturation = 1281 => Acros R
# CustomRendered = 1 + Saturation = 1282 => Acros Ye
# CustomRendered = 1 + Saturation = 1283 => Acros G
#
# FilmMode = 0 - Tag 0x1401 (2 bytes, int16u[1])
#
# 0 => Provia/Standard
# 512 => Velvia/Vivid
# 288 => Astia/Soft
# 1536 => Classic Chrome
# 1281 => Pro Neg Hi
# 1280 => Pro Neg Std
# 1792 => Eterna/Cinema
# 2048 => Classic Neg
# 2304 => Eterna Bleach Bypass
# 2560 => Nostalgic Neg
if [ -z "$1" ]
then
echo ""
echo " Print Film mode from Fujifim JPG file"
echo ""
echo " Usage:"
echo " $ ./getPictureInfo.sh *.JPG"
echo ""
exit 0
fi
COUNTER=0
PROCESSED=0
######################################################
for i in "$@"
do
output=`exiftool -v2 "$i" | grep "CustomRendered = 1"`
if [ -n "$output" ] ; then
# B&W
output=`exiftool -v2 "$i" | grep "Saturation ="`
if [[ "$output" == *"= 768"* ]] ; then
echo "$i" - "B&W"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 769"* ]] ; then
echo "$i" - "B&W R"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 770"* ]] ; then
echo "$i" - "B&W Ye"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 771"* ]] ; then
echo "$i" - "B&W G"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 784"* ]] ; then
echo "$i" - "Sepia"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 1280"* ]] ; then
echo "$i" - "Acros"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 1281"* ]] ; then
echo "$i" - "Acros R"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 1282"* ]] ; then
echo "$i" - "Acros Ye"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 1283"* ]] ; then
echo "$i" - "Acros G"
PROCESSED=$((PROCESSED+1))
fi
else
# Color film
output=`exiftool -v2 "$i" | grep "FilmMode = "`
if [[ "$output" == *"= 0"* ]]; then
echo "$i" - "Provia/Standard"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 512"* ]]; then
echo "$i" - "Velvia/Vivid"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 288"* ]]; then
echo "$i" - "Astia/Soft"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 1536"* ]]; then
echo "$i" - "Classic Chrome"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 1281"* ]]; then
echo "$i" - "PRO Neg.Hi"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 1280"* ]]; then
echo "$i" - "PRO Neg.Std"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 1792"* ]]; then
echo "$i" - "Eterna/Cinema"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 2048"* ]]; then
echo "$i" - "Classic Neg"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 2304"* ]]; then
echo "$i" - "Eterna Bleach Bypass"
PROCESSED=$((PROCESSED+1))
fi
if [[ "$output" == *"= 2560"* ]]; then
echo "$i" - "Nostalgic Neg"
PROCESSED=$((PROCESSED+1))
fi
fi
COUNTER=$((COUNTER+1))
done
echo "Done!"
######################################################
echo ""
echo "Total worked :" $COUNTER
echo "Total processed :" $PROCESSED