diff --git a/src/pentaxmn_int.cpp b/src/pentaxmn_int.cpp index a2ddd05470..e78aacb631 100644 --- a/src/pentaxmn_int.cpp +++ b/src/pentaxmn_int.cpp @@ -1175,11 +1175,11 @@ namespace Exiv2 { return os; } const uint32_t date = - (dateIt->toInt64(0) << 24) + (dateIt->toInt64(1) << 16) + - (dateIt->toInt64(2) << 8) + (dateIt->toInt64(3) << 0); + (dateIt->toUint32(0) << 24) + (dateIt->toUint32(1) << 16) + + (dateIt->toUint32(2) << 8) + (dateIt->toUint32(3) << 0); const uint32_t time = - (timeIt->toInt64(0) << 24) + (timeIt->toInt64(1) << 16) + - (timeIt->toInt64(2) << 8); + (timeIt->toUint32(0) << 24) + (timeIt->toUint32(1) << 16) + + (timeIt->toUint32(2) << 8); const uint32_t countEnc = (value.toUint32(0) << 24) + (value.toUint32(1) << 16) + (value.toUint32(2) << 8) + (value.toUint32(3) << 0); @@ -1276,13 +1276,13 @@ namespace Exiv2 { // 0x0207 Pentax LensInfo Undefined 36 3 255 0 0 40 148 71 152 80 6 241 65 237 153 88 36 1 76 107 251 255 255 255 0 0 80 6 241 0 0 0 0 0 0 0 0 unsigned long base = 1; - unsigned int autoAperture = lensInfo->toInt64(base+1) & 0x01 ; - unsigned int minAperture = lensInfo->toInt64(base+2) & 0x06 ; - unsigned int minFocusDistance = lensInfo->toInt64(base+3) & 0xf8 ; + unsigned int autoAperture = lensInfo->toUint32(base+1) & 0x01 ; + unsigned int minAperture = lensInfo->toUint32(base+2) & 0x06 ; + unsigned int minFocusDistance = lensInfo->toUint32(base+3) & 0xf8 ; - if ( autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && lensInfo->toInt64(base+4) == 148) index = 8; - if ( autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && lensInfo->toInt64(base+5) == 110) index = 7; - if ( autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && lensInfo->toInt64(base+4) == 110) index = 7; + if ( autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && lensInfo->toUint32(base+4) == 148) index = 8; + if ( autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && lensInfo->toUint32(base+5) == 110) index = 7; + if ( autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && lensInfo->toUint32(base+4) == 110) index = 7; } else if ( value.count() == 3 ) { // http://dev.exiv2.org/attachments/download/858/_IGP9032.DNG @@ -1290,15 +1290,15 @@ namespace Exiv2 { // 0x003f PentaxDng LensType Byte 3 3 255 0 // 0x0207 PentaxDng LensInfo Undefined 69 131 0 0 255 0 40 148 68 244 ... // 0 1 2 3 4 5 6 - if ( lensInfo->toInt64(4) == 0 && lensInfo->toInt64(5) == 40 && lensInfo->toInt64(6) == 148 ) index = 8; + if ( lensInfo->toUint32(4) == 0 && lensInfo->toUint32(5) == 40 && lensInfo->toUint32(6) == 148 ) index = 8; } else if ( value.count() == 4 ) { // http://dev.exiv2.org/attachments/download/868/IMGP2221.JPG // 0x0207 PentaxDng LensInfo Undefined 128 0 131 128 0 0 255 1 184 0 0 0 0 0 // 0 1 2 3 4 5 6 - if ( lensInfo->count() == 128 && lensInfo->toInt64(1) == 131 && lensInfo->toInt64(2) == 128 ) index = 8; + if ( lensInfo->count() == 128 && lensInfo->toUint32(1) == 131 && lensInfo->toUint32(2) == 128 ) index = 8; // #1155 - if ( lensInfo->toInt64(6) == 5 ) index = 7; + if ( lensInfo->toUint32(6) == 5 ) index = 7; } if ( index > 0 ) { @@ -1323,7 +1323,7 @@ namespace Exiv2 { const auto lensInfo = findLensInfo(metadata); if ( value.count() == 4 ) { std::string model = getKeyString("Exif.Image.Model" ,metadata); - if ( model.rfind("PENTAX K-3", 0)==0 && lensInfo->count() == 128 && lensInfo->toInt64(1) == 168 && lensInfo->toInt64(2) == 144 ) index = 7; + if ( model.rfind("PENTAX K-3", 0)==0 && lensInfo->count() == 128 && lensInfo->toUint32(1) == 168 && lensInfo->toUint32(2) == 144 ) index = 7; } if ( index > 0 ) { @@ -1348,7 +1348,7 @@ namespace Exiv2 { const auto lensInfo = findLensInfo(metadata); if ( value.count() == 4 ) { std::string model = getKeyString("Exif.Image.Model" ,metadata); - if ( model.rfind("PENTAX K-3", 0)==0 && lensInfo->count() == 128 && lensInfo->toInt64(1) == 131 && lensInfo->toInt64(2) == 128 ) + if ( model.rfind("PENTAX K-3", 0)==0 && lensInfo->count() == 128 && lensInfo->toUint32(1) == 131 && lensInfo->toUint32(2) == 128 ) index = 6; } if ( value.count() == 2 ) { diff --git a/src/preview.cpp b/src/preview.cpp index 3f2e79c009..52710308f7 100644 --- a/src/preview.cpp +++ b/src/preview.cpp @@ -522,13 +522,13 @@ namespace { const ExifData &exifData = image_.exifData(); auto pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_)); if (pos != exifData.end() && pos->count() > 0) { - offset_ = pos->toInt64(); + offset_ = pos->toUint32(); } size_ = 0; pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_)); if (pos != exifData.end() && pos->count() > 0) { - size_ = pos->toInt64(); + size_ = pos->toUint32(); } if (offset_ == 0 || size_ == 0) return; @@ -536,7 +536,7 @@ namespace { if (param_[parIdx].baseOffsetKey_) { pos = exifData.findKey(ExifKey(param_[parIdx].baseOffsetKey_)); if (pos != exifData.end() && pos->count() > 0) { - offset_ += pos->toInt64(); + offset_ += pos->toUint32(); } } @@ -712,19 +712,19 @@ namespace { if (pos == exifData.end()) return; if (offsetCount != pos->value().count()) return; for (int i = 0; i < offsetCount; i++) { - size_ += pos->toInt64(i); + size_ += pos->toUint32(i); } if (size_ == 0) return; pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageWidth")); if (pos != exifData.end() && pos->count() > 0) { - width_ = pos->toInt64(); + width_ = pos->toUint32(); } pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageLength")); if (pos != exifData.end() && pos->count() > 0) { - height_ = pos->toInt64(); + height_ = pos->toUint32(); } if (width_ == 0 || height_ == 0) return; @@ -852,8 +852,8 @@ namespace { if (formatDatum->toString() != "JPEG") return; - width_ = widthDatum->toInt64(); - height_ = heightDatum->toInt64(); + width_ = widthDatum->toUint32(); + height_ = heightDatum->toUint32(); preview_ = decodeBase64(imageDatum->toString()); size_ = static_cast(preview_.size()); valid_ = true; diff --git a/src/tiffvisitor_int.cpp b/src/tiffvisitor_int.cpp index 229d691091..23dc8d9dc4 100644 --- a/src/tiffvisitor_int.cpp +++ b/src/tiffvisitor_int.cpp @@ -997,7 +997,7 @@ namespace Exiv2 { uint32_t sizeTotal = 0; object->strips_.clear(); for (long i = 0; i < pos->count(); ++i) { - uint32_t len = pos->toInt64(i); + uint32_t len = pos->toUint32(i); object->strips_.emplace_back(zero, len); sizeTotal += len; }