#1153 Fixes for "Sony E PZ 16-50mm F3.5-5.6 OSS"

v0.27.3
Robin Mills 10 years ago
parent 32af620713
commit 28083d6667

@ -38,6 +38,7 @@ EXIV2_RCSID("@(#) $Id$")
#include "value.hpp" #include "value.hpp"
#include "exif.hpp" #include "exif.hpp"
#include "i18n.h" // NLS support. #include "i18n.h" // NLS support.
#include "datasets.hpp"
#include <string> #include <string>
#include <sstream> #include <sstream>
@ -1928,7 +1929,9 @@ namespace Exiv2 {
{ 45861, "Tamron SP AF 35-105mm F2.8 LD Aspherical IF" }, { 45861, "Tamron SP AF 35-105mm F2.8 LD Aspherical IF" },
{ 45871, "Tamron AF 70-210mm F2.8 SP LD" }, { 45871, "Tamron AF 70-210mm F2.8 SP LD" },
{0xffff, "Manual lens | " // 1 {0xffff, "Manual lens | " // 1
"Sony E 50mm F1.8 OSS" }, // 2 "Sony E 50mm F1.8 OSS | " // 2
"E PZ 16-50mm F3.5-5.6 OSS" // 3
}
}; };
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
@ -2136,13 +2139,20 @@ namespace Exiv2 {
{ {
try { try {
long lensID = 0xffff; long lensID = 0xffff;
long index = 0 ; long index = 1 ;
// #1153
std::string model = getKeyString("Exif.Image.Model" ,metadata); std::string model = getKeyString("Exif.Image.Model" ,metadata);
std::string maxAperture = getKeyString("Exif.Photo.MaxApertureValue" ,metadata); std::string maxAperture = getKeyString("Exif.Photo.MaxApertureValue" ,metadata);
std::string F1_8 = "434/256" ; std::string F1_8 = "434/256" ;
Exiv2::StringSet maxApertures;
maxApertures.insert( "926/256") ; // F3.5
maxApertures.insert("1024/256") ; // F4
maxApertures.insert("1110/256") ; // F4.5
maxApertures.insert("1188/256") ; // F5
maxApertures.insert("1272/256") ; // F5.6
// #1153
if ( model == "ILCE-6000" && maxAperture == F1_8 ) try { if ( model == "ILCE-6000" && maxAperture == F1_8 ) try {
long focalLength = getKeyLong ("Exif.Photo.FocalLength" ,metadata); long focalLength = getKeyLong ("Exif.Photo.FocalLength" ,metadata);
long focalL35mm = getKeyLong ("Exif.Photo.FocalLengthIn35mmFilm",metadata); long focalL35mm = getKeyLong ("Exif.Photo.FocalLengthIn35mmFilm",metadata);
@ -2150,6 +2160,13 @@ namespace Exiv2 {
if ( inRange(focalRatio,145,155) ) index = 2 ; if ( inRange(focalRatio,145,155) ) index = 2 ;
} catch (...) {} } catch (...) {}
if ( model == "ILCE-6000" && maxApertures.find(maxAperture) != maxApertures.end() ) try {
long focalLength = getKeyLong ("Exif.Photo.FocalLength" ,metadata);
long focalL35mm = getKeyLong ("Exif.Photo.FocalLengthIn35mmFilm",metadata);
long focalRatio = (focalL35mm*100)/focalLength;
if ( inRange(focalRatio,145,155) ) index = 3 ;
} catch (...) {}
if ( index > 0 ) return resolvedLens(os,lensID,index); if ( index > 0 ) return resolvedLens(os,lensID,index);
} catch (...) {} } catch (...) {}

@ -457,7 +457,7 @@ source ./functions.source
runTest exiv2 -PkV --grep GPSL http://dev.exiv2.org/attachments/download/805/DSC_7154.jpg | runTest exiv2 -m- $filename runTest exiv2 -PkV --grep GPSL http://dev.exiv2.org/attachments/download/805/DSC_7154.jpg | runTest exiv2 -m- $filename
runTest exiv2 -pa $filename runTest exiv2 -pa $filename
for num in 1140 1144a 1144b 1144c 1144d 1144e 1144f 1144g 1145a 1145b 1145c 1145d 1145e 1153; do for num in 1140 1144a 1144b 1144c 1144d 1144e 1144f 1144g 1145a 1145b 1145c 1145d 1145e; do
filename=exiv2-bug$num.exv filename=exiv2-bug$num.exv
printf "$num " >&3 printf "$num " >&3
echo '------>' Bug $num '<-------' >&2 echo '------>' Bug $num '<-------' >&2
@ -465,6 +465,14 @@ source ./functions.source
runTest exiv2 -pa -g Lens $filename runTest exiv2 -pa -g Lens $filename
done done
num=1153
printf "$num " >&3
for E in A J; do for i in a b c d e f g h i j k; do
filename=exiv2-bug$num${E}${i}.exv
echo '------>' Bug $num${E}${i} '<-------' >&2
copyTestFile $filename
runTest exiv2 -pa -g Lens $filename
done;done
) 3>&1 > $results 2>&1 ) 3>&1 > $results 2>&1

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save