#1144 Fix submitted. Thank You, Simon for the test files on dropbox. I have extracted the metadata and added it to the test suite.

v0.27.3
Robin Mills 10 years ago
parent 2f6188a713
commit 46d723b788

@ -1157,6 +1157,15 @@ namespace Exiv2 {
return result; return result;
} }
static long getKeyLong(const std::string& key,const ExifData* metadata)
{
long result = -1;
if ( metadata->findKey(ExifKey(key)) != metadata->end() ) {
result = (long) metadata->findKey(ExifKey(key))->toFloat(0);
}
return result;
}
std::ostream& resolveLens0x32c(std::ostream& os, const Value& value, std::ostream& resolveLens0x32c(std::ostream& os, const Value& value,
const ExifData* metadata) const ExifData* metadata)
{ {
@ -1165,11 +1174,14 @@ namespace Exiv2 {
unsigned long index = 0; unsigned long index = 0;
std::string model = getKeyString("Exif.Image.Model" ,metadata); std::string model = getKeyString("Exif.Image.Model" ,metadata);
std::string focalLength = getKeyString("Exif.Photo.FocalLength",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; // std::cout << "model,focalLength = " << model << "," << focalLength << std::endl;
if ( bFL10_20 && bK10D_K3 ) index = 1;
if ( model.find("PENTAX K10D") != std::string::npos && focalLength == "1700/100" ) index = 1;
if ( index > 0 ) { if ( index > 0 ) {
const TagDetails* td = find(pentaxLensType, lensID); const TagDetails* td = find(pentaxLensType, lensID);

@ -448,12 +448,12 @@ 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 1144; do for num in 1140 1144a 1144b 1144c 1144d 1144e 1144f 1144g ; 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
copyTestFile $filename copyTestFile $filename
runTest exiv2 -pv -g Lens $filename runTest exiv2 -pa -g Lens $filename
done done

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