From bf56bbf7fa8d40403db5f825fad321efa41d0160 Mon Sep 17 00:00:00 2001 From: draekko Date: Sun, 4 Sep 2016 11:22:40 +0000 Subject: [PATCH] #825 added printPressure for panasonic makernotes to display hPa values or infinite when value is 65535 for Exif field 0x0086 --- src/panasonicmn.cpp | 17 ++++++++++++++++- src/panasonicmn_int.hpp | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/panasonicmn.cpp b/src/panasonicmn.cpp index 29b97f24..0af25c96 100644 --- a/src/panasonicmn.cpp +++ b/src/panasonicmn.cpp @@ -511,7 +511,7 @@ namespace Exiv2 { TagInfo(0x0079, "IntelligentDRange", N_("Intelligent Dynamic Range"), N_("Intelligent Dynamic Range"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicIntelligentDRange)), TagInfo(0x007c, "ClearRetouch", N_("Clear Retouch"), N_("Clear Retouch"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicClearRetouch)), TagInfo(0x0080, "City2", N_("City2"), N_("City2"), panasonicId, makerTags, undefined, -1, printPanasonicText), - TagInfo(0x0086, "ManometerPressure", N_("Manometer Pressure"), N_("Manometer pressure"), panasonicId, makerTags, unsignedShort, -1, printValue), + TagInfo(0x0086, "ManometerPressure", N_("Manometer Pressure"), N_("Manometer pressure"), panasonicId, makerTags, unsignedShort, -1, printPressure), TagInfo(0x0089, "PhotoStyle", N_("Photo style"), N_("Photo style"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicPhotoStyle)), TagInfo(0x008a, "ShadingCompensation", N_("Shading Compensation"), N_("Shading Compensation"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicShadingCompensation)), TagInfo(0x008c, "AccelerometerZ", N_("Accelerometer Z"), N_("positive is acceleration upwards"), panasonicId, makerTags, unsignedShort, -1, printAccelerometer), @@ -685,6 +685,21 @@ namespace Exiv2 { }; } // PanasonicMakerNote::printPanasonicText + // Manometer Pressure + std::ostream& PanasonicMakerNote::printPressure(std::ostream& os, const Value& value, const ExifData*) + { + switch(value.toLong()) + { + case 65535: + os << N_("infinite"); + break; + default: + os << value << N_(" hPa"); + break; + }; + return os; + } // PanasonicMakerNote::printPressure + std::ostream& PanasonicMakerNote::printAccelerometer(std::ostream& os, const Value& value, const ExifData*) { // value is stored as unsigned int, but should be readed as signed int, so manually convert it diff --git a/src/panasonicmn_int.hpp b/src/panasonicmn_int.hpp index 07eeca40..7edf399e 100644 --- a/src/panasonicmn_int.hpp +++ b/src/panasonicmn_int.hpp @@ -73,6 +73,8 @@ namespace Exiv2 { static std::ostream& print0x0036(std::ostream& os, const Value& value, const ExifData*); //! Print ISO static std::ostream& print0x003c(std::ostream& os, const Value& value, const ExifData*); + //! Print Manometer Pressure + static std::ostream& printPressure(std::ostream& os, const Value& value, const ExifData*); //! Print special text values: title, landmark, county and so on static std::ostream& printPanasonicText(std::ostream& os, const Value& value, const ExifData*); //! Print accerometer readings