handling of zero; more precision for focal length

This commit is contained in:
norbertwg 2022-11-19 11:05:12 +01:00
parent 511659809b
commit 60661303a4
53 changed files with 393 additions and 66 deletions

View File

@ -2577,26 +2577,69 @@ std::ostream& printExifUnit(std::ostream& os, const Value& value, const ExifData
std::ostream& printLensSpecification(std::ostream& os, const Value& value, const ExifData*) {
std::ios::fmtflags f(os.flags());
if (value.count() != 4 || value.toRational(0).second == 0 || value.toRational(1).second == 0) {
// check type and count of values
if (value.typeId() != unsignedRational || value.count() != 4 ||
// divisor may be zero only if dividend is not zero
value.toRational(0).first != 0 && value.toRational(0).second == 0 ||
value.toRational(1).first != 0 && value.toRational(1).second == 0 ||
value.toRational(2).first != 0 && value.toRational(2).second == 0 ||
value.toRational(3).first != 0 && value.toRational(3).second == 0) {
os << "(" << value << ")";
return os;
}
const int64_t len1 = value.toInt64(0);
const int64_t len2 = value.toInt64(1);
// values numerically are ok, so they can be converted
// here first and second can be zero, so initialise float with 0.0
float focalLength1 = 0.0;
if (value.toRational(0).first != 0)
focalLength1 = value.toFloat(0);
float focalLength2 = 0.0;
if (value.toRational(1).first != 0)
focalLength2 = value.toFloat(1);
float fNumber1 = 0.0;
if (value.toRational(2).first != 0)
fNumber1 = value.toFloat(2);
float fNumber2 = 0.0;
if (value.toRational(3).first != 0)
fNumber2 = value.toFloat(3);
auto [r1, s1] = value.toRational(2);
auto [r2, s2] = value.toRational(3);
os << len1;
if (len2 != len1) {
os << "-" << len2;
// first value must not be bigger than second
if (focalLength1 > focalLength2 && focalLength2 > 0.0 || fNumber1 > fNumber2 && fNumber2 > 0.0) {
os << "(" << value << ")";
return os;
}
os << "mm ";
// no lens specification available
if (focalLength1 == 0.0 && focalLength2 == 0.0 && fNumber1 == 0.0 && fNumber2 == 0.0) {
os << "n/a";
return os;
}
// lens specification available - at least parts
if (focalLength1 == 0.0)
os << "n/a";
else
os << std::setprecision(5) << focalLength1;
if (focalLength1 != focalLength2) {
if (focalLength2 == 0.0)
os << "-n/a ";
else
os << "-" << std::setprecision(5) << focalLength2;
}
os << "mm";
std::ostringstream oss;
oss.copyfmt(os);
if (s1 > 0.0 && s2 > 0.0) {
os << "F" << std::setprecision(2) << static_cast<float>(r1) / s1;
if (r2 != r1) {
os << "-" << std::setprecision(2) << static_cast<float>(r2) / s2;
if (fNumber1 > 0.0 || fNumber2 > 0.0) {
os << " F";
if (fNumber1 == 0.0)
os << " n/a";
else
os << std::setprecision(2) << fNumber1;
if (fNumber1 != fNumber2) {
if (fNumber2 == 0.0)
os << "-n/a";
else
os << "-" << std::setprecision(2) << fNumber2;
}
}
os.copyfmt(oss);

View File

@ -41,7 +41,7 @@ Exif.Photo.ExposureMode Short 1 0 Auto
Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.FocalLengthIn35mmFilm Short 1 26 26.0 mm
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.LensSpecification Rational 4 17/4 17/4 9/5 9/5 4mm F1.8
Exif.Photo.LensSpecification Rational 4 17/4 17/4 9/5 9/5 4.25mm F1.8
Exif.Photo.LensMake Ascii 6 Apple Apple
Exif.Photo.LensModel Ascii 35 iPhone XR back camera 4.25mm f/1.8 iPhone XR back camera 4.25mm f/1.8
Exif.Photo.CompositeImage Short 1 2 GeneralComposite

View File

@ -200,7 +200,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 14 Peter Wemmert Peter Wemmert
Exif.Photo.BodySerialNumber Ascii 13 113053000536 113053000536
Exif.Photo.LensSpecification Rational 4 35/1 80/1 0/1 0/1 35-80mm F0
Exif.Photo.LensSpecification Rational 4 35/1 80/1 0/1 0/1 35-80mm
Exif.Photo.LensModel Ascii 21 EF35-80mm f/4-5.6 PZ EF35-80mm f/4-5.6 PZ
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 25802 25802

View File

@ -200,7 +200,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 14 Peter Wemmert Peter Wemmert
Exif.Photo.BodySerialNumber Ascii 13 113053000536 113053000536
Exif.Photo.LensSpecification Rational 4 35/1 80/1 0/1 0/1 35-80mm F0
Exif.Photo.LensSpecification Rational 4 35/1 80/1 0/1 0/1 35-80mm
Exif.Photo.LensModel Ascii 18 EF35-80mm f/4-5.6 EF35-80mm f/4-5.6
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 25798 25798

View File

@ -200,7 +200,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 14 Peter Wemmert Peter Wemmert
Exif.Photo.BodySerialNumber Ascii 13 113053000536 113053000536
Exif.Photo.LensSpecification Rational 4 35/1 80/1 0/1 0/1 35-80mm F0
Exif.Photo.LensSpecification Rational 4 35/1 80/1 0/1 0/1 35-80mm
Exif.Photo.LensModel Ascii 21 EF35-80mm f/4-5.6 II EF35-80mm f/4-5.6 II
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 25802 25802

View File

@ -200,7 +200,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 14 Peter Wemmert Peter Wemmert
Exif.Photo.BodySerialNumber Ascii 13 113053000536 113053000536
Exif.Photo.LensSpecification Rational 4 35/1 80/1 0/1 0/1 35-80mm F0
Exif.Photo.LensSpecification Rational 4 35/1 80/1 0/1 0/1 35-80mm
Exif.Photo.LensModel Ascii 22 EF35-80mm f/4-5.6 III EF35-80mm f/4-5.6 III
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 25802 25802

View File

@ -200,7 +200,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 14 Peter Wemmert Peter Wemmert
Exif.Photo.BodySerialNumber Ascii 13 113053000536 113053000536
Exif.Photo.LensSpecification Rational 4 35/1 80/1 0/1 0/1 35-80mm F0
Exif.Photo.LensSpecification Rational 4 35/1 80/1 0/1 0/1 35-80mm
Exif.Photo.LensModel Ascii 22 EF35-80mm f/4-5.6 USM EF35-80mm f/4-5.6 USM
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 25802 25802

View File

@ -197,7 +197,7 @@ Exif.Photo.ExposureMode Short 1 0 Auto
Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 27 Leonardo Brondani Schenkel Leonardo Brondani Schenkel
Exif.Photo.LensSpecification Rational 4 18/1 35/1 0/1 0/1 18-35mm F0
Exif.Photo.LensSpecification Rational 4 18/1 35/1 0/1 0/1 18-35mm
Exif.Photo.LensModel Ascii 8 18-35mm 18-35mm
Exif.Image.GPSTag Long 1 9406 9406
Exif.GPSInfo.GPSVersionID Byte 4 2 3 0 0 2.3.0.0

View File

@ -197,7 +197,7 @@ Exif.Photo.ExposureMode Short 1 0 Auto
Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 27 Leonardo Brondani Schenkel Leonardo Brondani Schenkel
Exif.Photo.LensSpecification Rational 4 18/1 35/1 0/1 0/1 18-35mm F0
Exif.Photo.LensSpecification Rational 4 18/1 35/1 0/1 0/1 18-35mm
Exif.Photo.LensModel Ascii 30 18-35mm F1.8 DC HSM | Art 013 18-35mm F1.8 DC HSM | Art 013
Exif.Image.GPSTag Long 1 9428 9428
Exif.GPSInfo.GPSVersionID Byte 4 2 3 0 0 2.3.0.0

View File

@ -139,7 +139,7 @@ Exif.Photo.SceneType Undefined 1 1 Directly photogra
Exif.Photo.ExposureMode Short 1 0 Auto
Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.FocalLengthIn35mmFilm Short 1 26 26.0 mm
Exif.Photo.LensSpecification Rational 4 807365/524263 6/1 8/5 12/5 1-6mm F1.6-2.4
Exif.Photo.LensSpecification Rational 4 807365/524263 6/1 8/5 12/5 1.54-6mm F1.6-2.4
Exif.Photo.LensMake Ascii 6 Apple Apple
Exif.Photo.LensModel Ascii 45 iPhone 12 Pro back triple camera 4.2mm f/1.6 iPhone 12 Pro back triple camera 4.2mm f/1.6
Exif.Image.GPSTag Long 1 4630 4630

View File

@ -40,7 +40,7 @@ Exif.Photo.ExposureMode Short 1 0 Auto
Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.FocalLengthIn35mmFilm Short 1 26 26.0 mm
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.LensSpecification Rational 4 17/4 17/4 9/5 9/5 4mm F1.8
Exif.Photo.LensSpecification Rational 4 17/4 17/4 9/5 9/5 4.25mm F1.8
Exif.Photo.LensMake Ascii 6 Apple Apple
Exif.Photo.LensModel Ascii 35 iPhone XR back camera 4.25mm f/1.8 iPhone XR back camera 4.25mm f/1.8
Exif.Photo.CompositeImage Short 1 2 GeneralComposite

View File

@ -216,7 +216,7 @@ Exif.Photo.ExposureMode Short 1 0 Auto
Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.LensSpecification Rational 4 14/1 24/1 0/1 0/1 14-24mm F0
Exif.Photo.LensSpecification Rational 4 14/1 24/1 0/1 0/1 14-24mm
Exif.Photo.LensModel Ascii 30 14-24mm F2.8 DG HSM | Art 018 14-24mm F2.8 DG HSM | Art 018
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 42390 42390

View File

@ -217,7 +217,7 @@ Exif.Photo.ExposureMode Short 1 0 Auto
Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.LensSpecification Rational 4 28/1 28/1 0/1 0/1 28mm F0
Exif.Photo.LensSpecification Rational 4 28/1 28/1 0/1 0/1 28mm
Exif.Photo.LensModel Ascii 27 28mm F1.4 DG HSM | Art 019 28mm F1.4 DG HSM | Art 019
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 42400 42400

View File

@ -218,7 +218,7 @@ Exif.Photo.ExposureMode Short 1 0 Auto
Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.LensSpecification Rational 4 35/1 35/1 0/1 0/1 35mm F0
Exif.Photo.LensSpecification Rational 4 35/1 35/1 0/1 0/1 35mm
Exif.Photo.LensModel Ascii 27 35mm F1.4 DG HSM | Art 012 35mm F1.4 DG HSM | Art 012
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 43020 43020

View File

@ -216,7 +216,7 @@ Exif.Photo.ExposureMode Short 1 0 Auto
Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.LensSpecification Rational 4 40/1 40/1 0/1 0/1 40mm F0
Exif.Photo.LensSpecification Rational 4 40/1 40/1 0/1 0/1 40mm
Exif.Photo.LensModel Ascii 27 40mm F1.4 DG HSM | Art 018 40mm F1.4 DG HSM | Art 018
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 42388 42388

View File

@ -218,7 +218,7 @@ Exif.Photo.ExposureMode Short 1 0 Auto
Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.LensSpecification Rational 4 50/1 50/1 0/1 0/1 50mm F0
Exif.Photo.LensSpecification Rational 4 50/1 50/1 0/1 0/1 50mm
Exif.Photo.LensModel Ascii 27 50mm F1.4 DG HSM | Art 014 50mm F1.4 DG HSM | Art 014
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 43020 43020

View File

@ -216,7 +216,7 @@ Exif.Photo.ExposureMode Short 1 1 Manual
Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.LensSpecification Rational 4 60/1 600/1 0/1 0/1 60-600mm F0
Exif.Photo.LensSpecification Rational 4 60/1 600/1 0/1 0/1 60-600mm
Exif.Photo.LensModel Ascii 41 60-600mm F4.5-6.3 DG OS HSM | Sports 018 60-600mm F4.5-6.3 DG OS HSM | Sports 018
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 42402 42402

View File

@ -196,7 +196,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 253020008411 253020008411
Exif.Photo.LensSpecification Rational 4 15/1 30/1 0/1 0/1 15-30mm F0
Exif.Photo.LensSpecification Rational 4 15/1 30/1 0/1 0/1 15-30mm
Exif.Photo.LensModel Ascii 39 TAMRON SP 15-30mm F/2.8 Di VC USD A012 TAMRON SP 15-30mm F/2.8 Di VC USD A012
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 8930 8930

View File

@ -186,7 +186,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 32
Exif.Photo.BodySerialNumber Ascii 13 043022015995 043022015995
Exif.Photo.LensSpecification Rational 4 90/1 90/1 0/0 0/0 90mm
Exif.Photo.LensSpecification Rational 4 90/1 90/1 0/0 0/0 90mm
Exif.Photo.LensModel Ascii 70 TAMRON SP 90mm F/2.8 Di VC USD MACRO1:1 F017 TAMRON SP 90mm F/2.8 Di VC USD MACRO1:1 F017
Exif.Photo.LensSerialNumber Ascii 12 0000000000 0000000000
Exif.Photo.Gamma Rational 1 22/10 2.2

View File

@ -223,7 +223,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 16 Martin Straeten Martin Straeten
Exif.Photo.BodySerialNumber Ascii 13 143055002120 143055002120
Exif.Photo.LensSpecification Rational 4 200/1 800/1 0/1 0/1 200-800mm F0
Exif.Photo.LensSpecification Rational 4 200/1 800/1 0/1 0/1 200-800mm
Exif.Photo.LensModel Ascii 37 EF100-400mm f/4.5-5.6L IS II USM +2x EF100-400mm f/4.5-5.6L IS II USM +2x
Exif.Photo.LensSerialNumber Ascii 11 3490009075 3490009075
Exif.Image.GPSTag Long 1 43202 43202

View File

@ -130,5 +130,5 @@ Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.Contrast Short 1 0 Normal
Exif.Photo.Saturation Short 1 0 Normal
Exif.Photo.Sharpness Short 1 0 Normal
Exif.Photo.LensSpecification Rational 4 430/100 12900/100 35/10 63/10 4-129mm F3.5-6.3
Exif.Photo.LensSpecification Rational 4 430/100 12900/100 35/10 63/10 4.3-129mm F3.5-6.3
Exif.Image.PrintImageMatching Undefined 28 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0

View File

@ -131,7 +131,7 @@ Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.Contrast Short 1 0 Normal
Exif.Photo.Saturation Short 1 0 Normal
Exif.Photo.Sharpness Short 1 0 Normal
Exif.Photo.LensSpecification Rational 4 880/100 2570/100 18/10 28/10 8-25mm F1.8-2.8
Exif.Photo.LensSpecification Rational 4 880/100 2570/100 18/10 28/10 8.8-25.7mm F1.8-2.8
Exif.Image.PrintImageMatching Undefined 28 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0
Exif.Thumbnail.Compression Short 1 6 JPEG (old-style)
Exif.Thumbnail.ImageDescription Ascii 32

View File

@ -196,7 +196,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 093026001758 093026001758
Exif.Photo.LensSpecification Rational 4 300/1 1000/1 0/1 0/1 300-1000mm F0
Exif.Photo.LensSpecification Rational 4 300/1 1000/1 0/1 0/1 300-1000mm
Exif.Photo.LensModel Ascii 11 300-1000mm 300-1000mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 8934 8934

View File

@ -196,7 +196,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 093026001758 093026001758
Exif.Photo.LensSpecification Rational 4 300/1 1000/1 0/1 0/1 300-1000mm F0
Exif.Photo.LensSpecification Rational 4 300/1 1000/1 0/1 0/1 300-1000mm
Exif.Photo.LensModel Ascii 11 300-1000mm 300-1000mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 8934 8934

View File

@ -98,7 +98,7 @@ Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.Contrast Short 1 0 Normal
Exif.Photo.Saturation Short 1 0 Normal
Exif.Photo.Sharpness Short 1 0 Normal
Exif.Photo.LensSpecification Rational 4 0/10 0/10 0/10 0/10 0mm F0
Exif.Photo.LensSpecification Rational 4 0/10 0/10 0/10 0/10 n/a
Exif.Photo.LensModel Ascii 5 ---- ----
Exif.Image.GPSTag Long 1 21004 21004
Exif.GPSInfo.GPSVersionID Byte 4 2 3 0 0 2.3.0.0

View File

@ -98,7 +98,7 @@ Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.Contrast Short 1 0 Normal
Exif.Photo.Saturation Short 1 0 Normal
Exif.Photo.Sharpness Short 1 0 Normal
Exif.Photo.LensSpecification Rational 4 0/10 0/10 0/10 0/10 0mm F0
Exif.Photo.LensSpecification Rational 4 0/10 0/10 0/10 0/10 n/a
Exif.Photo.LensModel Ascii 5 ---- ----
Exif.Image.GPSTag Long 1 21004 21004
Exif.GPSInfo.GPSVersionID Byte 4 2 3 0 0 2.3.0.0

View File

@ -199,7 +199,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 153026000424 153026000424
Exif.Photo.LensSpecification Rational 4 11/1 20/1 0/1 0/1 11-20mm F0
Exif.Photo.LensSpecification Rational 4 11/1 20/1 0/1 0/1 11-20mm
Exif.Photo.LensModel Ascii 8 11-20mm 11-20mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 9400 9400

View File

@ -199,7 +199,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 153026000424 153026000424
Exif.Photo.LensSpecification Rational 4 17/1 70/1 0/1 0/1 17-70mm F0
Exif.Photo.LensSpecification Rational 4 17/1 70/1 0/1 0/1 17-70mm
Exif.Photo.LensModel Ascii 8 17-70mm 17-70mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 9400 9400

View File

@ -196,7 +196,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 053024015642 053024015642
Exif.Photo.LensSpecification Rational 4 35/1 35/1 0/1 0/1 35mm F0
Exif.Photo.LensSpecification Rational 4 35/1 35/1 0/1 0/1 35mm
Exif.Photo.LensModel Ascii 5 35mm 35mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.DateTimeOriginal Ascii 20 2016:03:22 12:58:55 2016:03:22 12:58:55

View File

@ -70,7 +70,7 @@ Exif.NikonIi.ISO2 Byte 1 72 200
Exif.NikonIi.ISOExpansion2 Short 1 0 Off
Exif.Nikon3.ShutterMode Short 1 16 Electronic
Exif.Nikon3.LensType Byte 1 16 (16)
Exif.Nikon3.Lens Rational 4 110/10 275/10 35/10 56/10 11-27mm F3.5-5.6
Exif.Nikon3.Lens Rational 4 110/10 275/10 35/10 56/10 11-27.5mm F3.5-5.6
Exif.Nikon3.FlashMode Byte 1 0 Did not fire
Exif.Nikon3.ShootingMode Short 1 32 Single-frame, Auto ISO
Exif.Nikon3.AutoBracketRelease Short 1 1 Auto release

View File

@ -213,7 +213,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 148024000654 148024000654
Exif.Photo.LensSpecification Rational 4 120/1 300/1 0/1 0/1 120-300mm F0
Exif.Photo.LensSpecification Rational 4 120/1 300/1 0/1 0/1 120-300mm
Exif.Photo.LensModel Ascii 10 120-300mm 120-300mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 9302 9302

View File

@ -213,7 +213,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 148024000654 148024000654
Exif.Photo.LensSpecification Rational 4 150/1 500/1 0/1 0/1 150-500mm F0
Exif.Photo.LensSpecification Rational 4 150/1 500/1 0/1 0/1 150-500mm
Exif.Photo.LensModel Ascii 10 150-500mm 150-500mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 9302 9302

View File

@ -186,7 +186,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 32
Exif.Photo.BodySerialNumber Ascii 13 043022015995 043022015995
Exif.Photo.LensSpecification Rational 4 90/1 90/1 0/0 0/0 90mm
Exif.Photo.LensSpecification Rational 4 90/1 90/1 0/0 0/0 90mm
Exif.Photo.LensModel Ascii 70 TAMRON SP 90mm F/2.8 Di VC USD MACRO1:1 F017 TAMRON SP 90mm F/2.8 Di VC USD MACRO1:1 F017
Exif.Photo.LensSerialNumber Ascii 12 0000000000 0000000000
Exif.Photo.Gamma Rational 1 22/10 2.2

View File

@ -131,7 +131,7 @@ Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.Contrast Short 1 0 Normal
Exif.Photo.Saturation Short 1 0 Normal
Exif.Photo.Sharpness Short 1 0 Normal
Exif.Photo.LensSpecification Rational 4 880/100 7330/100 28/10 28/10 8-73mm F2.8
Exif.Photo.LensSpecification Rational 4 880/100 7330/100 28/10 28/10 8.8-73.3mm F2.8
Exif.Image.PrintImageMatching Undefined 28 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0
Exif.Thumbnail.Compression Short 1 6 JPEG (old-style)
Exif.Thumbnail.ImageDescription Ascii 32

View File

@ -133,7 +133,7 @@ Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.Contrast Short 1 0 Normal
Exif.Photo.Saturation Short 1 0 Normal
Exif.Photo.Sharpness Short 1 0 Normal
Exif.Photo.LensSpecification Rational 4 940/100 2570/100 18/10 28/10 9-25mm F1.8-2.8
Exif.Photo.LensSpecification Rational 4 940/100 2570/100 18/10 28/10 9.4-25.7mm F1.8-2.8
Exif.Image.PrintImageMatching Undefined 28 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0
Exif.Thumbnail.Compression Short 1 6 JPEG (old-style)
Exif.Thumbnail.ImageDescription Ascii 32

View File

@ -136,7 +136,7 @@ Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.Contrast Short 1 0 Normal
Exif.Photo.Saturation Short 1 0 Normal
Exif.Photo.Sharpness Short 1 0 Normal
Exif.Photo.LensSpecification Rational 4 880/100 2570/100 18/10 28/10 8-25mm F1.8-2.8
Exif.Photo.LensSpecification Rational 4 880/100 2570/100 18/10 28/10 8.8-25.7mm F1.8-2.8
Exif.Image.PrintImageMatching Undefined 28 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0
Exif.Thumbnail.Compression Short 1 6 JPEG (old-style)
Exif.Thumbnail.ImageDescription Ascii 32

View File

@ -180,7 +180,7 @@ Exif.Photo.DigitalZoomRatio Rational 1 6000/6000 1.0
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 613050001534 613050001534
Exif.Photo.LensSpecification Rational 4 15/1 45/1 0/1 0/1 15-45mm F0
Exif.Photo.LensSpecification Rational 4 15/1 45/1 0/1 0/1 15-45mm
Exif.Photo.LensModel Ascii 29 EF-M15-45mm f/3.5-6.3 IS STM EF-M15-45mm f/3.5-6.3 IS STM
Exif.Photo.LensSerialNumber Ascii 11 000002544e 000002544e
Exif.Image.GPSTag Long 1 15884 15884

View File

@ -197,7 +197,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 12 Danny Heijl Danny Heijl
Exif.Photo.BodySerialNumber Ascii 13 693035001174 693035001174
Exif.Photo.LensSpecification Rational 4 30/1 30/1 0/1 0/1 30mm F0
Exif.Photo.LensSpecification Rational 4 30/1 30/1 0/1 0/1 30mm
Exif.Photo.LensModel Ascii 35 30mm F1.4 DC DN | Contemporary 016 30mm F1.4 DC DN | Contemporary 016
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 6426 6426

View File

@ -230,7 +230,7 @@ Exif.Photo.WhiteBalance Short 1 0 Auto
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 403022001947 403022001947
Exif.Photo.LensSpecification Rational 4 24/1 105/1 0/1 0/1 24-105mm F0
Exif.Photo.LensSpecification Rational 4 24/1 105/1 0/1 0/1 24-105mm
Exif.Photo.LensModel Ascii 25 RF24-105mm F4-7.1 IS STM RF24-105mm F4-7.1 IS STM
Exif.Photo.LensSerialNumber Ascii 11 000002a620 000002a620
Exif.Image.GPSTag Long 1 10982 10982

View File

@ -147,7 +147,7 @@ Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.Contrast Short 1 0 Normal
Exif.Photo.Saturation Short 1 0 Normal
Exif.Photo.Sharpness Short 1 0 Normal
Exif.Photo.LensSpecification Rational 4 1040/100 3710/100 18/10 49/10 10-37mm F1.8-4.9
Exif.Photo.LensSpecification Rational 4 1040/100 3710/100 18/10 49/10 10.4-37.1mm F1.8-4.9
Exif.Image.PrintImageMatching Undefined 28 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0
Exif.Thumbnail.Compression Short 1 6 JPEG (old-style)
Exif.Thumbnail.ImageDescription Ascii 32

View File

@ -147,7 +147,7 @@ Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.Contrast Short 1 0 Normal
Exif.Photo.Saturation Short 1 0 Normal
Exif.Photo.Sharpness Short 1 0 Normal
Exif.Photo.LensSpecification Rational 4 1040/100 3710/100 18/10 49/10 10-37mm F1.8-4.9
Exif.Photo.LensSpecification Rational 4 1040/100 3710/100 18/10 49/10 10.4-37.1mm F1.8-4.9
Exif.Image.PrintImageMatching Undefined 28 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0
Exif.Thumbnail.Compression Short 1 6 JPEG (old-style)
Exif.Thumbnail.ImageDescription Ascii 32

View File

@ -147,7 +147,7 @@ Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.Contrast Short 1 0 Normal
Exif.Photo.Saturation Short 1 0 Normal
Exif.Photo.Sharpness Short 1 0 Normal
Exif.Photo.LensSpecification Rational 4 1040/100 3710/100 18/10 49/10 10-37mm F1.8-4.9
Exif.Photo.LensSpecification Rational 4 1040/100 3710/100 18/10 49/10 10.4-37.1mm F1.8-4.9
Exif.Image.PrintImageMatching Undefined 28 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0 80 114 105 110 116 73 77 0 48 51 48 48 0 0 2 0 2 0 1 0 0 0 1 1 1 0 0 0
Exif.Thumbnail.Compression Short 1 6 JPEG (old-style)
Exif.Thumbnail.ImageDescription Ascii 32

View File

@ -219,7 +219,7 @@ Exif.Photo.WhiteBalance Short 1 1 Manual
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 263057004424 263057004424
Exif.Photo.LensSpecification Rational 4 35/1 35/1 0/1 0/1 35mm F0
Exif.Photo.LensSpecification Rational 4 35/1 35/1 0/1 0/1 35mm
Exif.Photo.LensModel Ascii 27 35mm F1.4 DG HSM | Art 012 35mm F1.4 DG HSM | Art 012
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 10476 10476

View File

@ -223,7 +223,7 @@ Exif.Photo.WhiteBalance Short 1 1 Manual
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 263057004424 263057004424
Exif.Photo.LensSpecification Rational 4 35/1 35/1 0/1 0/1 35mm F0
Exif.Photo.LensSpecification Rational 4 35/1 35/1 0/1 0/1 35mm
Exif.Photo.LensModel Ascii 27 35mm F1.4 DG HSM | Art 012 35mm F1.4 DG HSM | Art 012
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 43156 43156

View File

@ -223,7 +223,7 @@ Exif.Photo.WhiteBalance Short 1 1 Manual
Exif.Photo.SceneCaptureType Short 1 0 Standard
Exif.Photo.CameraOwnerName Ascii 1
Exif.Photo.BodySerialNumber Ascii 13 263057004424 263057004424
Exif.Photo.LensSpecification Rational 4 28/1 80/1 0/1 0/1 28-80mm F0
Exif.Photo.LensSpecification Rational 4 28/1 80/1 0/1 0/1 28-80mm
Exif.Photo.LensModel Ascii 20 EF28-80mm f/3.5-5.6 EF28-80mm f/3.5-5.6
Exif.Photo.LensSerialNumber Ascii 11 0000000000 0000000000
Exif.Image.GPSTag Long 1 43148 43148

View File

@ -0,0 +1,284 @@
# -*- coding: utf-8 -*-
from system_tests import CaseMeta, CopyTmpFiles, path
#####################################################################
# Standard cases (correct values)
#####################################################################
@CopyTmpFiles("$data_path/exiv2-empty.jpg")
class LensSpecificationCorrect(metaclass=CaseMeta):
filename = path("$tmp_path/exiv2-empty.jpg")
commands = [
"""$exiv2 -u -v -M"add Exif.Photo.LensSpecification 1000/10 1000/10 28/10 28/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 280/10 700/10 28/10 28/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 280/10 700/10 28/10 40/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 28/10 70/10 28/10 40/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename"
]
stdout = ["""File 1/1: $filename
Add Exif.Photo.LensSpecification "1000/10 1000/10 28/10 28/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 100mm F2.8
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "280/10 700/10 28/10 28/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 28-70mm F2.8
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "280/10 700/10 28/10 40/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 28-70mm F2.8-4
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "28/10 70/10 28/10 40/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 2.8-7mm F2.8-4
"""
]
stderr = [""] * len(commands)
retval = [0] * len(commands)
#####################################################################
# empty lens specification (all zeros)
#####################################################################
@CopyTmpFiles("$data_path/exiv2-empty.jpg")
class LensSpecificationEmpty(metaclass=CaseMeta):
filename = path("$tmp_path/exiv2-empty.jpg")
commands = [
"""$exiv2 -u -v -M"add Exif.Photo.LensSpecification 0/0 0/0 0/0 0/0" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename"
]
stdout = ["""File 1/1: $filename
Add Exif.Photo.LensSpecification "0/0 0/0 0/0 0/0" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 n/a
"""
]
stderr = [""] * len(commands)
retval = [0] * len(commands)
#####################################################################
# Exif.Photo.LensSpecification filled with wrong type: Ascii
#####################################################################
@CopyTmpFiles("$data_path/exiv2-empty.jpg")
class LensSpecificationAscii(metaclass=CaseMeta):
filename = path("$tmp_path/exiv2-empty.jpg")
commands = [
"""$exiv2 -u -v -M"add Exif.Photo.LensSpecification Ascii 1/10 2/10 3/10 4/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename"
]
stdout = ["""File 1/1: $filename
Add Exif.Photo.LensSpecification "1/10 2/10 3/10 4/10" (Ascii)
""",
"""Exif.Photo.LensSpecification Ascii 20 (1/10 2/10 3/10 4/10)
"""
]
stderr = [""] * len(commands)
retval = [0] * len(commands)
#####################################################################
# Exif.Photo.LensSpecification filled with wrong type: Byte (4 values)
#####################################################################
@CopyTmpFiles("$data_path/exiv2-empty.jpg")
class LensSpecification4Byte(metaclass=CaseMeta):
filename = path("$tmp_path/exiv2-empty.jpg")
commands = [
"""$exiv2 -u -v -M"add Exif.Photo.LensSpecification Byte 1 2 3 4" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename"
]
stdout = ["""File 1/1: $filename
Add Exif.Photo.LensSpecification "1 2 3 4" (Byte)
""",
"""Exif.Photo.LensSpecification Byte 4 (1 2 3 4)
"""
]
stderr = [""] * len(commands)
retval = [0] * len(commands)
#####################################################################
# Exif.Photo.LensSpecification filled with wrong number of values
#####################################################################
@CopyTmpFiles("$data_path/exiv2-empty.jpg")
class LensSpecification5Rational(metaclass=CaseMeta):
filename = path("$tmp_path/exiv2-empty.jpg")
commands = [
"""$exiv2 -u -v -M"add Exif.Photo.LensSpecification 1/10 2/10 3/10 4/10 5/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename"
]
stdout = ["""File 1/1: $filename
Add Exif.Photo.LensSpecification "1/10 2/10 3/10 4/10 5/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 5 (1/10 2/10 3/10 4/10 5/10)
"""
]
stderr = [""] * len(commands)
retval = [0] * len(commands)
#####################################################################
# divisor is zero
#####################################################################
@CopyTmpFiles("$data_path/exiv2-empty.jpg")
class LensSpecificationZeroDevisor(metaclass=CaseMeta):
filename = path("$tmp_path/exiv2-empty.jpg")
commands = [
"""$exiv2 -u -v -M"add Exif.Photo.LensSpecification 1/0 2/10 3/10 4/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 1/10 2/0 3/10 4/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 1/10 2/10 3/0 4/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 1/10 2/10 3/10 4/0" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename"
]
stdout = ["""File 1/1: $filename
Add Exif.Photo.LensSpecification "1/0 2/10 3/10 4/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 (1/0 2/10 3/10 4/10)
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "1/10 2/0 3/10 4/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 (1/10 2/0 3/10 4/10)
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "1/10 2/10 3/0 4/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 (1/10 2/10 3/0 4/10)
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "1/10 2/10 3/10 4/0" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 (1/10 2/10 3/10 4/0)
"""
]
stderr = [""] * len(commands)
retval = [0] * len(commands)
#####################################################################
# dividend is zero
#####################################################################
@CopyTmpFiles("$data_path/exiv2-empty.jpg")
class LensSpecificationZeroDevidend(metaclass=CaseMeta):
filename = path("$tmp_path/exiv2-empty.jpg")
commands = [
"""$exiv2 -u -v -M"add Exif.Photo.LensSpecification 0/10 200/10 33/10 44/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 100/10 0/10 33/10 44/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 100/10 200/10 0/10 44/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 100/10 200/10 33/10 0/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename"
]
stdout = ["""File 1/1: $filename
Add Exif.Photo.LensSpecification "0/10 200/10 33/10 44/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 n/a-20mm F3.3-4.4
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "100/10 0/10 33/10 44/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 10-n/a mm F3.3-4.4
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "100/10 200/10 0/10 44/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 10-20mm F n/a-4.4
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "100/10 200/10 33/10 0/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 10-20mm F3.3-n/a
"""
]
stderr = [""] * len(commands)
retval = [0] * len(commands)
#####################################################################
# dividend and divisor is zero
#####################################################################
@CopyTmpFiles("$data_path/exiv2-empty.jpg")
class LensSpecificationZeroDevidendDivisior(metaclass=CaseMeta):
filename = path("$tmp_path/exiv2-empty.jpg")
commands = [
"""$exiv2 -u -v -M"add Exif.Photo.LensSpecification 0/0 200/10 33/10 44/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 100/10 0/0 33/10 44/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 100/10 200/10 0/0 44/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 100/10 200/10 33/10 0/0" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename"
]
stdout = ["""File 1/1: $filename
Add Exif.Photo.LensSpecification "0/0 200/10 33/10 44/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 n/a-20mm F3.3-4.4
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "100/10 0/0 33/10 44/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 10-n/a mm F3.3-4.4
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "100/10 200/10 0/0 44/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 10-20mm F n/a-4.4
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "100/10 200/10 33/10 0/0" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 10-20mm F3.3-n/a
"""
]
stderr = [""] * len(commands)
retval = [0] * len(commands)
#####################################################################
# first value bigger than second
#####################################################################
@CopyTmpFiles("$data_path/exiv2-empty.jpg")
class LensSpecificationFirstBiggerSecond(metaclass=CaseMeta):
filename = path("$tmp_path/exiv2-empty.jpg")
commands = [
"""$exiv2 -u -v -M"add Exif.Photo.LensSpecification 2010/100 200/10 33/10 44/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename",
"""$exiv2 -u -v -M"set Exif.Photo.LensSpecification 100/10 200/10 441/100 44/10" $filename""",
"$exiv2 -KExif.Photo.LensSpecification $filename"
]
stdout = ["""File 1/1: $filename
Add Exif.Photo.LensSpecification "2010/100 200/10 33/10 44/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 (2010/100 200/10 33/10 44/10)
""",
"""File 1/1: $filename
Set Exif.Photo.LensSpecification "100/10 200/10 441/100 44/10" (Rational)
""",
"""Exif.Photo.LensSpecification Rational 4 (100/10 200/10 441/100 44/10)
"""
]
stderr = [""] * len(commands)
retval = [0] * len(commands)

View File

@ -27,7 +27,7 @@ class TamronSupport(metaclass=system_tests.CaseMeta):
Exif.CanonCs.Lens Short 3 90.0 mm
Exif.Canon.LensModel Ascii 70 TAMRON SP 90mm F/2.8 Di VC USD MACRO1:1 F017
Exif.CanonLe.LensSerialNumber SLong 1 0
Exif.Photo.LensSpecification Rational 4 90mm
Exif.Photo.LensSpecification Rational 4 90mm
Exif.Photo.LensModel Ascii 70 TAMRON SP 90mm F/2.8 Di VC USD MACRO1:1 F017
Exif.Photo.LensSerialNumber Ascii 12 0000000000
""",

View File

@ -23,7 +23,7 @@ class CheckLensDetectionTeleconverter(metaclass=system_tests.CaseMeta):
Exif.CanonCs.Lens Short 3 300.0 - 1000.0 mm
Exif.Canon.LensModel Ascii 74 300-1000mm
Exif.CanonLe.LensSerialNumber SLong 1 0
Exif.Photo.LensSpecification Rational 4 300-1000mm F0
Exif.Photo.LensSpecification Rational 4 300-1000mm
Exif.Photo.LensModel Ascii 11 300-1000mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000
"""

View File

@ -27,12 +27,12 @@ Exif.Photo.LensModel Ascii 20 DT 11-18mm F4.5-5.6
""",
"""Exif.Sony1.LensID Long 1 Tamron SP AF 17-50mm F2.8 XR Di II LD Aspherical
Exif.Sony1.LensSpec Byte 8 Unknown
Exif.Photo.LensSpecification Rational 4 0mm F0
Exif.Photo.LensSpecification Rational 4 n/a
Exif.Photo.LensModel Ascii 5 ----
""",
"""Exif.Sony1.LensID Long 1 Tamron AF 18-200mm F3.5-6.3 XR Di II LD Aspherical [IF] Macro
Exif.Sony1.LensSpec Byte 8 Unknown
Exif.Photo.LensSpecification Rational 4 0mm F0
Exif.Photo.LensSpecification Rational 4 n/a
Exif.Photo.LensModel Ascii 5 ----
""",
"""Exif.Sony1.LensID Long 1 Tamron SP 70-300mm F4-5.6 Di USD

View File

@ -14,7 +14,7 @@ class CheckTokina11_20mm(metaclass=system_tests.CaseMeta):
Exif.CanonCs.Lens Short 3 11.0 - 20.0 mm
Exif.Canon.LensModel Ascii 74 11-20mm
Exif.CanonLe.LensSerialNumber SLong 1 0
Exif.Photo.LensSpecification Rational 4 11-20mm F0
Exif.Photo.LensSpecification Rational 4 11-20mm
Exif.Photo.LensModel Ascii 8 11-20mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000
""",

View File

@ -14,7 +14,7 @@ class CheckSigma17_70Lens(metaclass=system_tests.CaseMeta):
Exif.CanonCs.Lens Short 3 17.0 - 70.0 mm
Exif.Canon.LensModel Ascii 74 17-70mm
Exif.CanonLe.LensSerialNumber SLong 1 0
Exif.Photo.LensSpecification Rational 4 17-70mm F0
Exif.Photo.LensSpecification Rational 4 17-70mm
Exif.Photo.LensModel Ascii 8 17-70mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000
""",

View File

@ -14,7 +14,7 @@ class CheckSigma35mm(metaclass=system_tests.CaseMeta):
Exif.CanonCs.Lens Short 3 35.0 mm
Exif.Canon.LensModel Ascii 74 35mm
Exif.CanonLe.LensSerialNumber SLong 1 0
Exif.Photo.LensSpecification Rational 4 35mm F0
Exif.Photo.LensSpecification Rational 4 35mm
Exif.Photo.LensModel Ascii 5 35mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000
""",

View File

@ -22,7 +22,7 @@ Exif.Canon.LensModel Ascii 74 120-300mm
Exif.CanonLe.LensSerialNumber SLong 1 0
Exif.CanonAfC.USMLensElectronicMF SLong 1 Enable After AF
Exif.CanonAfC.LensDriveWhenAFImpossible SLong 1 Continue Focus Search
Exif.Photo.LensSpecification Rational 4 120-300mm F0
Exif.Photo.LensSpecification Rational 4 120-300mm
Exif.Photo.LensModel Ascii 10 120-300mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000
""",
@ -32,7 +32,7 @@ Exif.Canon.LensModel Ascii 74 150-500mm
Exif.CanonLe.LensSerialNumber SLong 1 0
Exif.CanonAfC.USMLensElectronicMF SLong 1 Enable After AF
Exif.CanonAfC.LensDriveWhenAFImpossible SLong 1 Continue Focus Search
Exif.Photo.LensSpecification Rational 4 150-500mm F0
Exif.Photo.LensSpecification Rational 4 150-500mm
Exif.Photo.LensModel Ascii 10 150-500mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000
"""