#1155. Fixes submitted. Thank You, Hannu for reporting this and providing test data.

v0.27.3
Robin Mills 10 years ago
parent e02d142e4d
commit e99a3687f3

@ -1175,15 +1175,11 @@ namespace Exiv2 {
unsigned long lensID = 0x32c;
unsigned long index = 0;
std::string model = getKeyString("Exif.Image.Model" ,metadata);
long focalLength = getKeyLong ("Exif.Photo.FocalLength",metadata);
bool bFL10_20 = 10 <= focalLength && focalLength <= 20;
bool bK10D_K3 = model.find("PENTAX K10D") != std::string::npos
|| model.find("PENTAX K-3") != std::string::npos
;
// std::cout << "model,focalLength = " << model << "," << focalLength << std::endl;
if ( bFL10_20 && bK10D_K3 ) index = 1;
if ( bFL10_20 ) index = 1;
if ( index > 0 ) {
const TagDetails* td = find(pentaxLensType, lensID);
@ -1223,9 +1219,11 @@ namespace Exiv2 {
unsigned int autoAperture = lensInfo->toLong(base+1) & 0x01 ;
unsigned int minAperture = lensInfo->toLong(base+2) & 0x06 ;
unsigned int minFocusDistance = lensInfo->toLong(base+3) & 0xf8 ;
unsigned int dontKnow = lensInfo->toLong(base+4);
if ( autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && dontKnow == 148) index = 8;
if ( autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && lensInfo->toLong(base+4) == 148) index = 8;
if ( autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && lensInfo->toLong(base+5) == 110) index = 7;
if ( autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && lensInfo->toLong(base+4) == 110) index = 7;
} else if ( value.count() == 3 ) {
// http://dev.exiv2.org/attachments/download/858/_IGP9032.DNG
// $ exiv2 -pv --grep Lens ~/Downloads/_IGP9032.DNG
@ -1294,7 +1292,15 @@ namespace Exiv2 {
;
if ( value.count() == 4 ) {
std::string model = getKeyString("Exif.Image.Model" ,metadata);
if ( model.find("PENTAX K-3")==0 && lensInfo->count() == 128 && lensInfo->toLong(1) == 131 && lensInfo->toLong(2) == 128 ) index = 6;
if ( model.find("PENTAX K-3")==0 && lensInfo->count() == 128 && lensInfo->toLong(1) == 131 && lensInfo->toLong(2) == 128 )
index = 6;
}
if ( value.count() == 2 ) {
std::string model = getKeyString("Exif.Image.Model" ,metadata);
if ( model.find("PENTAX K100D")==0 && lensInfo->count() == 44 )
index = 6;
if ( model.find("PENTAX *ist DL")==0 && lensInfo->count() == 36 )
index = 6;
}
if ( index > 0 ) {

@ -469,8 +469,8 @@ source ./functions.source
for i in a b c d e f g; do
filename=exiv2-bug$num$i.exv
echo '------>' Bug $num$i '<-------' >&2
copyTestFile $filename
runTest exiv2 -pa -g Lens $filename
copyTestFile $filename
runTest exiv2 -pa -g Lens $filename
done
num=1145
@ -478,8 +478,8 @@ source ./functions.source
for i in a b c d e; do
filename=exiv2-bug$num$i.exv
echo '------>' Bug $num$i '<-------' >&2
copyTestFile $filename
runTest exiv2 -pa -g Lens $filename
copyTestFile $filename
runTest exiv2 -pa -g Lens $filename
done
num=1153
@ -487,17 +487,17 @@ source ./functions.source
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
copyTestFile $filename
runTest exiv2 -pa -g Lens $filename
done;done
num=1155
printf "$num " >&3
for i in a b c; do
for i in a b c d e f g h i; do
filename=exiv2-bug$num${i}.exv
echo '------>' Bug $num${i} '<-------' >&2
copyTestFile $filename
runTest exiv2 -pa -g Lens $filename
copyTestFile $filename
runTest exiv2 -pa -g Lens $filename
done
) 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.
Loading…
Cancel
Save