diff --git a/src/pentaxmn.cpp b/src/pentaxmn.cpp index eba7e843..4f265eca 100644 --- a/src/pentaxmn.cpp +++ b/src/pentaxmn.cpp @@ -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 ) { diff --git a/test/bugfixes-test.sh b/test/bugfixes-test.sh index a14e1d51..954e6d5e 100755 --- a/test/bugfixes-test.sh +++ b/test/bugfixes-test.sh @@ -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 diff --git a/test/data/bugfixes-test.out b/test/data/bugfixes-test.out index 16221152..9233ed22 100644 Binary files a/test/data/bugfixes-test.out and b/test/data/bugfixes-test.out differ diff --git a/test/data/exiv2-bug1155d.exv b/test/data/exiv2-bug1155d.exv new file mode 100644 index 00000000..3c8f95c8 Binary files /dev/null and b/test/data/exiv2-bug1155d.exv differ diff --git a/test/data/exiv2-bug1155e.exv b/test/data/exiv2-bug1155e.exv new file mode 100644 index 00000000..c62e4bd0 Binary files /dev/null and b/test/data/exiv2-bug1155e.exv differ diff --git a/test/data/exiv2-bug1155f.exv b/test/data/exiv2-bug1155f.exv new file mode 100644 index 00000000..bae1e13c Binary files /dev/null and b/test/data/exiv2-bug1155f.exv differ diff --git a/test/data/exiv2-bug1155g.exv b/test/data/exiv2-bug1155g.exv new file mode 100644 index 00000000..1f753acb Binary files /dev/null and b/test/data/exiv2-bug1155g.exv differ diff --git a/test/data/exiv2-bug1155h.exv b/test/data/exiv2-bug1155h.exv new file mode 100644 index 00000000..911aaeca Binary files /dev/null and b/test/data/exiv2-bug1155h.exv differ diff --git a/test/data/exiv2-bug1155i.exv b/test/data/exiv2-bug1155i.exv new file mode 100644 index 00000000..ef8a0529 Binary files /dev/null and b/test/data/exiv2-bug1155i.exv differ