Blame test/iso65k-test.sh

Packit Service 21b5d1
#!/bin/bash
Packit Service 21b5d1
# test for ISOs which follow Annex G of EXIF 2.3 spec, i.e. ISOs,
Packit Service 21b5d1
# which cannot be represented by Exif.Photo.ISOSpeedRatings due to
Packit Service 21b5d1
# being larger than 65k
Packit Service 21b5d1
Packit Service 21b5d1
# All tests use the summary view as a result-check, because it uses
Packit Service 21b5d1
# the isoSpeed() "easyaccess" function, which handles the higher ISO
Packit Service 21b5d1
# readout.
Packit Service 21b5d1
#
Packit Service 21b5d1
# Tests getting executed:
Packit Service 21b5d1
#
Packit Service 21b5d1
Packit Service 21b5d1
source ./functions.source
Packit Service 21b5d1
Packit Service 21b5d1
(   cd "$testdir"
Packit Service 21b5d1
Packit Service 21b5d1
    num=0001
Packit Service 21b5d1
    # Checks for old way of ISO readout based on the 16bit value
Packit Service 21b5d1
    # input:
Packit Service 21b5d1
    # - Exif.Photo.ISOSpeedRatings being set to something <65k
Packit Service 21b5d1
    # output:
Packit Service 21b5d1
    # - value of Exif.Photo.ISOSpeedRatings
Packit Service 21b5d1
    echo '------>' iso65k test $num '<-------' >&2
Packit Service 21b5d1
    filename=exiv2-iso65k-$num.jpg
Packit Service 21b5d1
    copyTestFile exiv2-empty.jpg $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 60001'            $filename
Packit Service 21b5d1
    runTest exiv2 -ps                                                 $filename
Packit Service 21b5d1
Packit Service 21b5d1
    num=0002
Packit Service 21b5d1
    # Old ISO is read out first, so if it doesn't indicate that
Packit Service 21b5d1
    # some higher ISO is used, the 16bit value should be returned,
Packit Service 21b5d1
    # ignoring the other tags (for now)
Packit Service 21b5d1
    # input:
Packit Service 21b5d1
    # - Exif.Photo.ISOSpeedRatings being set to something <65k
Packit Service 21b5d1
    # - Exif.Photo.SensitivityType being set to "REI"
Packit Service 21b5d1
    # - Exif.Photo.RecommendedExposureIndex being set to != ISOSpeedRatings
Packit Service 21b5d1
    # output:
Packit Service 21b5d1
    # - value of Exif.Photo.ISOSpeedRatings
Packit Service 21b5d1
    echo '------>' iso65k test $num '<-------' >&2
Packit Service 21b5d1
    filename=exiv2-iso65k-$num.jpg
Packit Service 21b5d1
    copyTestFile exiv2-empty.jpg $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 60002'            $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.SensitivityType 2'                $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.RecommendedExposureIndex 444444'  $filename
Packit Service 21b5d1
    runTest exiv2 -ps                                                 $filename
Packit Service 21b5d1
Packit Service 21b5d1
    num=0003
Packit Service 21b5d1
    # Corner case check (highest ISO value not indicating possible
Packit Service 21b5d1
    # 16bit overflow in ISO)
Packit Service 21b5d1
    # input:
Packit Service 21b5d1
    # - Exif.Photo.ISOSpeedRatings being set to 65534
Packit Service 21b5d1
    # output:
Packit Service 21b5d1
    # - value of Exif.Photo.ISOSpeedRatings
Packit Service 21b5d1
    echo '------>' iso65k test $num '<-------' >&2
Packit Service 21b5d1
    filename=exiv2-iso65k-$num.jpg
Packit Service 21b5d1
    copyTestFile exiv2-empty.jpg $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65534'            $filename
Packit Service 21b5d1
    runTest exiv2 -ps                                                 $filename
Packit Service 21b5d1
Packit Service 21b5d1
    num=0004
Packit Service 21b5d1
    # Corner case check (ISO value indicating possible overflow,
Packit Service 21b5d1
    # but no additional informations available)
Packit Service 21b5d1
    # input:
Packit Service 21b5d1
    # - Exif.Photo.ISOSpeedRatings being set to 65535
Packit Service 21b5d1
    # - Exif.Photo.SensitivityType NOT SET
Packit Service 21b5d1
    # output:
Packit Service 21b5d1
    # - value of Exif.Photo.ISOSpeedRatings
Packit Service 21b5d1
    echo '------>' iso65k test $num '<-------' >&2
Packit Service 21b5d1
    filename=exiv2-iso65k-$num.jpg
Packit Service 21b5d1
    copyTestFile exiv2-empty.jpg $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65535'            $filename
Packit Service 21b5d1
    runTest exiv2 -ps                                                 $filename
Packit Service 21b5d1
Packit Service 21b5d1
    num=0005
Packit Service 21b5d1
    # possible ISO value overflow, but additional information not valid
Packit Service 21b5d1
    # input:
Packit Service 21b5d1
    # - Exif.Photo.ISOSpeedRatings being set to 65535
Packit Service 21b5d1
    # - Exif.Photo.SensitivityType being set to 0
Packit Service 21b5d1
    # output:
Packit Service 21b5d1
    # - value of Exif.Photo.ISOSpeedRatings
Packit Service 21b5d1
    echo '------>' iso65k test $num '<-------' >&2
Packit Service 21b5d1
    filename=exiv2-iso65k-$num.jpg
Packit Service 21b5d1
    copyTestFile exiv2-empty.jpg $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65535'            $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.SensitivityType 0'                $filename
Packit Service 21b5d1
    runTest exiv2 -ps                                                 $filename
Packit Service 21b5d1
Packit Service 21b5d1
    num=0006
Packit Service 21b5d1
    # possible ISO value overflow, but additional information not valid
Packit Service 21b5d1
    # input:
Packit Service 21b5d1
    # - Exif.Photo.ISOSpeedRatings being set to 65535
Packit Service 21b5d1
    # - Exif.Photo.SensitivityType being set to 8
Packit Service 21b5d1
    # output:
Packit Service 21b5d1
    # - value of Exif.Photo.ISOSpeedRatings
Packit Service 21b5d1
    echo '------>' iso65k test $num '<-------' >&2
Packit Service 21b5d1
    filename=exiv2-iso65k-$num.jpg
Packit Service 21b5d1
    copyTestFile exiv2-empty.jpg $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65535'            $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.SensitivityType 8'                $filename
Packit Service 21b5d1
    runTest exiv2 -ps                                                 $filename
Packit Service 21b5d1
Packit Service 21b5d1
    num=0007
Packit Service 21b5d1
    # possible ISO value overflow, but additional information partially valid
Packit Service 21b5d1
    # input:
Packit Service 21b5d1
    # - Exif.Photo.ISOSpeedRatings being set to 65535
Packit Service 21b5d1
    # - Exif.Photo.SensitivityType being set to 2 ("REI")
Packit Service 21b5d1
    # - Exif.Photo.RecommendedExposureIndex NOT SET
Packit Service 21b5d1
    # output:
Packit Service 21b5d1
    # - value of Exif.Photo.ISOSpeedRatings
Packit Service 21b5d1
    echo '------>' iso65k test $num '<-------' >&2
Packit Service 21b5d1
    filename=exiv2-iso65k-$num.jpg
Packit Service 21b5d1
    copyTestFile exiv2-empty.jpg $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65535'            $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.SensitivityType 2'                $filename
Packit Service 21b5d1
    runTest exiv2 -ps                                                 $filename
Packit Service 21b5d1
Packit Service 21b5d1
    num=0008
Packit Service 21b5d1
    # ISO value overflow, REI contains same value as 16bit ISO, though
Packit Service 21b5d1
    # input:
Packit Service 21b5d1
    # - Exif.Photo.ISOSpeedRatings being set to 65535
Packit Service 21b5d1
    # - Exif.Photo.SensitivityType being set to 2 ("REI")
Packit Service 21b5d1
    # - Exif.Photo.RecommendedExposureIndex set to 65530
Packit Service 21b5d1
    # output:
Packit Service 21b5d1
    # - value of Exif.Photo.RecommendedExposureIndex
Packit Service 21b5d1
    echo '------>' iso65k test $num '<-------' >&2
Packit Service 21b5d1
    filename=exiv2-iso65k-$num.jpg
Packit Service 21b5d1
    copyTestFile exiv2-empty.jpg $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65535'            $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.SensitivityType 2'                $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.RecommendedExposureIndex 65530'   $filename
Packit Service 21b5d1
    runTest exiv2 -ps                                                 $filename
Packit Service 21b5d1
Packit Service 21b5d1
    num=0009
Packit Service 21b5d1
    # ISO value overflow, REI contains 16bit ISO value +1
Packit Service 21b5d1
    # input:
Packit Service 21b5d1
    # - Exif.Photo.ISOSpeedRatings being set to 65535
Packit Service 21b5d1
    # - Exif.Photo.SensitivityType being set to 2 ("REI")
Packit Service 21b5d1
    # - Exif.Photo.RecommendedExposureIndex set to 65536
Packit Service 21b5d1
    # output:
Packit Service 21b5d1
    # - value of Exif.Photo.RecommendedExposureIndex
Packit Service 21b5d1
    echo '------>' iso65k test $num '<-------' >&2
Packit Service 21b5d1
    filename=exiv2-iso65k-$num.jpg
Packit Service 21b5d1
    copyTestFile exiv2-empty.jpg $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.ISOSpeedRatings 65535'            $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.SensitivityType 2'                $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.RecommendedExposureIndex 65536'   $filename
Packit Service 21b5d1
    runTest exiv2 -ps                                                 $filename
Packit Service 21b5d1
Packit Service 21b5d1
    num=0010
Packit Service 21b5d1
    # old ISO not set
Packit Service 21b5d1
    # input:
Packit Service 21b5d1
    # - Exif.Photo.ISOSpeedRatings is NOT SET
Packit Service 21b5d1
    # - Exif.Photo.SensitivityType being set to 2 ("REI")
Packit Service 21b5d1
    # - Exif.Photo.RecommendedExposureIndex set to <65k
Packit Service 21b5d1
    # output:
Packit Service 21b5d1
    # - value of Exif.Photo.RecommendedExposureIndex
Packit Service 21b5d1
    echo '------>' iso65k test $num '<-------' >&2
Packit Service 21b5d1
    filename=exiv2-iso65k-$num.jpg
Packit Service 21b5d1
    copyTestFile exiv2-empty.jpg $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.SensitivityType 2'                $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.RecommendedExposureIndex 60010'   $filename
Packit Service 21b5d1
    runTest exiv2 -ps                                                 $filename
Packit Service 21b5d1
Packit Service 21b5d1
    num=0011
Packit Service 21b5d1
    # old ISO not set
Packit Service 21b5d1
    # input:
Packit Service 21b5d1
    # - Exif.Photo.ISOSpeedRatings is NOT SET
Packit Service 21b5d1
    # - Exif.Photo.SensitivityType being set to 2 ("REI")
Packit Service 21b5d1
    # - Exif.Photo.RecommendedExposureIndex set to >65k
Packit Service 21b5d1
    # output:
Packit Service 21b5d1
    # - value of Exif.Photo.RecommendedExposureIndex
Packit Service 21b5d1
    echo '------>' iso65k test $num '<-------' >&2
Packit Service 21b5d1
    filename=exiv2-iso65k-$num.jpg
Packit Service 21b5d1
    copyTestFile exiv2-empty.jpg $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.SensitivityType 2'                $filename
Packit Service 21b5d1
    runTest exiv2 -M'set Exif.Photo.RecommendedExposureIndex 100011'  $filename
Packit Service 21b5d1
    runTest exiv2 -ps                                                 $filename
Packit Service 21b5d1
Packit Service 21b5d1
) > $testdir/iso65k-test.out 2>&1
Packit Service 21b5d1
Packit Service 21b5d1
reportTest