iso65k-test.sh

test/iso65k-test.sh - Spex Duplex, 10 May 2015 07:58

Download (7.12 KB)

 
1
#!/bin/bash
2
# test for ISOs which follow Annex G of EXIF 2.3 spec, i.e. ISOs,
3
# which cannot be represented by Exif.Photo.ISOSpeedRatings due to
4
# being larger than 65k
5

    
6
# All tests use the summary view as a result-check, because it uses
7
# the isoSpeed() "easyaccess" function, which handles the higher ISO
8
# readout.
9
#
10
# Tests getting executed:
11
# 
12

    
13
source ./functions.source
14

    
15
(	cd "$testdir"
16

    
17
	num=0001
18
	# Checks for old way of ISO readout based on the 16bit value
19
	# input:
20
	# - Exif.Photo.ISOSpeedRatings being set to something <65k
21
	# output:
22
	# - value of Exif.Photo.ISOSpeedRatings
23
	echo '------>' iso65k test $num '<-------' >&2
24
	filename=exiv2-iso65k-$num.jpg
25
	copyTestFile exiv2-empty.jpg $filename
26
	runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 60001'            $filename
27
	runTest exiv2 -ps                                                 $filename
28

    
29
	num=0002
30
	# Old ISO is read out first, so if it doesn't indicate that
31
	# some higher ISO is used, the 16bit value should be returned,
32
	# ignoring the other tags (for now)
33
	# input:
34
	# - Exif.Photo.ISOSpeedRatings being set to something <65k
35
	# - Exif.Photo.SensitivityType being set to "REI"
36
	# - Exif.Photo.RecommendedExposureIndex being set to != ISOSpeedRatings
37
	# output:
38
	# - value of Exif.Photo.ISOSpeedRatings
39
	echo '------>' iso65k test $num '<-------' >&2
40
	filename=exiv2-iso65k-$num.jpg
41
	copyTestFile exiv2-empty.jpg $filename
42
	runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 60002'            $filename
43
	runTest exiv2 -M'set Exif.Photo.SensitivityType 2'                $filename
44
	runTest exiv2 -M'set Exif.Photo.RecommendedExposureIndex 444444'  $filename
45
	runTest exiv2 -ps                                                 $filename
46

    
47
	num=0003
48
	# Corner case check (highest ISO value not indicating possible
49
	# 16bit overflow in ISO)
50
	# input:
51
	# - Exif.Photo.ISOSpeedRatings being set to 65534
52
	# output:
53
	# - value of Exif.Photo.ISOSpeedRatings
54
	echo '------>' iso65k test $num '<-------' >&2
55
	filename=exiv2-iso65k-$num.jpg
56
	copyTestFile exiv2-empty.jpg $filename
57
	runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65534'            $filename
58
	runTest exiv2 -ps                                                 $filename
59

    
60
	num=0004
61
	# Corner case check (ISO value indicating possible overflow,
62
	# but no additional informations available)
63
	# input:
64
	# - Exif.Photo.ISOSpeedRatings being set to 65535
65
	# - Exif.Photo.SensitivityType NOT SET
66
	# output:
67
	# - value of Exif.Photo.ISOSpeedRatings
68
	echo '------>' iso65k test $num '<-------' >&2
69
	filename=exiv2-iso65k-$num.jpg
70
	copyTestFile exiv2-empty.jpg $filename
71
	runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65535'            $filename
72
	runTest exiv2 -ps                                                 $filename
73

    
74
	num=0005
75
	# possible ISO value overflow, but additional information not valid
76
	# input:
77
	# - Exif.Photo.ISOSpeedRatings being set to 65535
78
	# - Exif.Photo.SensitivityType being set to 0
79
	# output:
80
	# - value of Exif.Photo.ISOSpeedRatings
81
	echo '------>' iso65k test $num '<-------' >&2
82
	filename=exiv2-iso65k-$num.jpg
83
	copyTestFile exiv2-empty.jpg $filename
84
	runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65535'            $filename
85
	runTest exiv2 -M'set Exif.Photo.SensitivityType 0'                $filename
86
	runTest exiv2 -ps                                                 $filename
87

    
88
	num=0006
89
	# possible ISO value overflow, but additional information not valid
90
	# input:
91
	# - Exif.Photo.ISOSpeedRatings being set to 65535
92
	# - Exif.Photo.SensitivityType being set to 8
93
	# output:
94
	# - value of Exif.Photo.ISOSpeedRatings
95
	echo '------>' iso65k test $num '<-------' >&2
96
	filename=exiv2-iso65k-$num.jpg
97
	copyTestFile exiv2-empty.jpg $filename
98
	runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65535'            $filename
99
	runTest exiv2 -M'set Exif.Photo.SensitivityType 8'                $filename
100
	runTest exiv2 -ps                                                 $filename
101

    
102
	num=0007
103
	# possible ISO value overflow, but additional information partially valid
104
	# input:
105
	# - Exif.Photo.ISOSpeedRatings being set to 65535
106
	# - Exif.Photo.SensitivityType being set to 2 ("REI")
107
	# - Exif.Photo.RecommendedExposureIndex NOT SET
108
	# output:
109
	# - value of Exif.Photo.ISOSpeedRatings
110
	echo '------>' iso65k test $num '<-------' >&2
111
	filename=exiv2-iso65k-$num.jpg
112
	copyTestFile exiv2-empty.jpg $filename
113
	runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65535'            $filename
114
	runTest exiv2 -M'set Exif.Photo.SensitivityType 2'                $filename
115
	runTest exiv2 -ps                                                 $filename
116

    
117
	num=0008
118
	# ISO value overflow, REI contains same value as 16bit ISO, though
119
	# input:
120
	# - Exif.Photo.ISOSpeedRatings being set to 65535
121
	# - Exif.Photo.SensitivityType being set to 2 ("REI")
122
	# - Exif.Photo.RecommendedExposureIndex set to 65530
123
	# output:
124
	# - value of Exif.Photo.RecommendedExposureIndex
125
	echo '------>' iso65k test $num '<-------' >&2
126
	filename=exiv2-iso65k-$num.jpg
127
	copyTestFile exiv2-empty.jpg $filename
128
	runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65535'            $filename
129
	runTest exiv2 -M'set Exif.Photo.SensitivityType 2'                $filename
130
	runTest exiv2 -M'set Exif.Photo.RecommendedExposureIndex 65530'   $filename
131
	runTest exiv2 -ps                                                 $filename
132

    
133
	num=0009
134
	# ISO value overflow, REI contains 16bit ISO value +1
135
	# input:
136
	# - Exif.Photo.ISOSpeedRatings being set to 65535
137
	# - Exif.Photo.SensitivityType being set to 2 ("REI")
138
	# - Exif.Photo.RecommendedExposureIndex set to 65536
139
	# output:
140
	# - value of Exif.Photo.RecommendedExposureIndex
141
	echo '------>' iso65k test $num '<-------' >&2
142
	filename=exiv2-iso65k-$num.jpg
143
	copyTestFile exiv2-empty.jpg $filename
144
	runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65535'            $filename
145
	runTest exiv2 -M'set Exif.Photo.SensitivityType 2'                $filename
146
	runTest exiv2 -M'set Exif.Photo.RecommendedExposureIndex 65536'   $filename
147
	runTest exiv2 -ps                                                 $filename
148

    
149
	num=0010
150
	# old ISO not set
151
	# input:
152
	# - Exif.Photo.ISOSpeedRatings is NOT SET
153
	# - Exif.Photo.SensitivityType being set to 2 ("REI")
154
	# - Exif.Photo.RecommendedExposureIndex set to <65k
155
	# output:
156
	# - value of Exif.Photo.RecommendedExposureIndex
157
	echo '------>' iso65k test $num '<-------' >&2
158
	filename=exiv2-iso65k-$num.jpg
159
	copyTestFile exiv2-empty.jpg $filename
160
	runTest exiv2 -M'set Exif.Photo.SensitivityType 2'                $filename
161
	runTest exiv2 -M'set Exif.Photo.RecommendedExposureIndex 60010'   $filename
162
	runTest exiv2 -ps                                                 $filename
163

    
164
	num=0011
165
	# old ISO not set
166
	# input:
167
	# - Exif.Photo.ISOSpeedRatings is NOT SET
168
	# - Exif.Photo.SensitivityType being set to 2 ("REI")
169
	# - Exif.Photo.RecommendedExposureIndex set to >65k
170
	# output:
171
	# - value of Exif.Photo.RecommendedExposureIndex
172
	echo '------>' iso65k test $num '<-------' >&2
173
	filename=exiv2-iso65k-$num.jpg
174
	copyTestFile exiv2-empty.jpg $filename
175
	runTest exiv2 -M'set Exif.Photo.SensitivityType 2'                $filename
176
	runTest exiv2 -M'set Exif.Photo.RecommendedExposureIndex 100011'  $filename
177
	runTest exiv2 -ps                                                 $filename
178

    
179
) > $testdir/iso65k-test.out 2>&1
180

    
181
reportTest
Redmine Appliance - Powered by TurnKey Linux