diff --git a/src/properties.cpp b/src/properties.cpp index 560819e2..a215b8ad 100644 --- a/src/properties.cpp +++ b/src/properties.cpp @@ -813,7 +813,19 @@ namespace Exiv2 { {"Xmp.exif.GPSStatus", EXV_PRINT_TAG(xmpExifGPSStatus)}, {"Xmp.exif.GPSTrackRef", EXV_PRINT_TAG(xmpExifGPSDirection)}, {"Xmp.tiff.XResolution", printLong}, - {"Xmp.tiff.YResolution", printLong} + {"Xmp.tiff.YResolution", printLong}, + {"Xmp.exif.DateTimeOriginal", printDate}, + {"Xmp.exif.GPSTimeStamp", printDate}, + {"Xmp.exif.CreateDate", printDate}, + {"Xmp.exif.ModifyDate", printDate}, + {"Xmp.exif.ApertureValue", print0x9202}, + {"Xmp.exif.FNumber", print0x9202}, + {"Xmp.exif.BrightnessValue", printLong}, + {"Xmp.exif.ExposureBiasValue", printLong}, + {"Xmp.exif.FocalLength", print0x920a}, + {"Xmp.exif.FocalPlaneXResolution", printFloat}, + {"Xmp.exif.FocalPlaneYResolution", printFloat}, + {"Xmp.exif.ShutterSpeedValue", print0x9201} }; XmpNsInfo::Ns::Ns(const std::string& ns) diff --git a/src/tags.cpp b/src/tags.cpp index 82223b9e..109bf528 100644 --- a/src/tags.cpp +++ b/src/tags.cpp @@ -2037,6 +2037,24 @@ namespace Exiv2 { return os; } + std::ostream& printDate(std::ostream& os, const Value& value) + { + if (value.size() != 20 || value.typeId() != xmpText) { + return os << "(" << value << ")"; + } + + std::string stringValue = value.toString(); + if (stringValue[19] == 'Z') { + stringValue = stringValue.substr(0, 19); + } + for (unsigned int i = 0; i < stringValue.length(); ++i) { + if (stringValue[i] == 'T') stringValue[i] = ' '; + if (stringValue[i] == '-') stringValue[i] = ':'; + } + + return os << stringValue; + } + float fnumber(float apertureValue) { return static_cast(std::exp(std::log(2.0) * apertureValue / 2)); diff --git a/src/tags.hpp b/src/tags.hpp index 6b813bc8..a9a741e6 100644 --- a/src/tags.hpp +++ b/src/tags.hpp @@ -479,6 +479,8 @@ namespace Exiv2 { std::ostream& print0xa405(std::ostream& os, const Value& value); //! Print any version packed in 4 Bytes format : major major minor minor std::ostream& printVersion(std::ostream& os, const Value& value); + //! Print a date following the format YYYY-MM-DDTHH:MM:SSZ + std::ostream& printDate(std::ostream& os, const Value& value); //@} //! Calculate F number from an APEX aperture value diff --git a/src/xmp.cpp b/src/xmp.cpp index 087c3b66..3ea3e75a 100644 --- a/src/xmp.cpp +++ b/src/xmp.cpp @@ -667,6 +667,7 @@ namespace Exiv2 { // ************************************************************************* // free functions + std::ostream& operator<<(std::ostream& os, const Xmpdatum& md) { return XmpProperties::printProperty(os, md.key(), md.value());