diff --git a/TinyEXIF.cpp b/TinyEXIF.cpp index 6b0c6d8..029cb62 100644 --- a/TinyEXIF.cpp +++ b/TinyEXIF.cpp @@ -1092,6 +1092,8 @@ int EXIFInfo::parseFromXMPSegmentXML(const char* szXML, unsigned len) { ParseXMP::Value(document, "drone-parrot:CameraYawDegree", GeoLocation.YawDegree); ParseXMP::Value(document, "Camera:AboveGroundAltitude", GeoLocation.RelativeAltitude); } + ParseXMP::Value(document, "GPano:PosePitchDegrees", GPano.PosePitchDegrees); + ParseXMP::Value(document, "GPano:PoseRollDegrees", GPano.PoseRollDegrees); return PARSE_SUCCESS; } @@ -1143,6 +1145,13 @@ bool EXIFInfo::Geolocation_t::hasSpeed() const { return SpeedX != DBL_MAX && SpeedY != DBL_MAX && SpeedZ != DBL_MAX; } +bool EXIFInfo::GPano_t::hasPosePitchDegrees() const { + return PosePitchDegrees != DBL_MAX; +} + +bool EXIFInfo::GPano_t::hasPoseRollDegrees() const { + return PoseRollDegrees != DBL_MAX; +} void EXIFInfo::clear() { Fields = FIELD_NA; @@ -1230,6 +1239,10 @@ void EXIFInfo::clear() { GeoLocation.LonComponents.minutes = 0; GeoLocation.LonComponents.seconds = 0; GeoLocation.LonComponents.direction = 0; + + // GPano + GPano.PosePitchDegrees = DBL_MAX; + GPano.PoseRollDegrees = DBL_MAX; } } // namespace TinyEXIF diff --git a/TinyEXIF.h b/TinyEXIF.h index 8ff7d4a..fed8d81 100644 --- a/TinyEXIF.h +++ b/TinyEXIF.h @@ -298,6 +298,12 @@ public: bool hasOrientation() const; // Return true if (roll,yaw,pitch) is available bool hasSpeed() const; // Return true if (speedX,speedY,speedZ) is available } GeoLocation; + struct TINYEXIF_LIB GPano_t { // Spherical metadata. https://developers.google.com/streetview/spherical-metadata + double PosePitchDegrees; // Pitch, measured in degrees above the horizon, for the center in the image. Value must be >= -90 and <= 90. + double PoseRollDegrees; // Roll, measured in degrees, of the image where level with the horizon is 0. As roll increases, the horizon rotates counterclockwise in the image. Value must be > -180 and <= 180. + bool hasPosePitchDegrees() const; // Return true if PosePitchDegrees is available + bool hasPoseRollDegrees() const; // Return true if PoseRollDegrees is available + } GPano; }; } // namespace TinyEXIF diff --git a/main.cpp b/main.cpp index 323128b..476c476 100644 --- a/main.cpp +++ b/main.cpp @@ -147,5 +147,9 @@ int main(int argc, const char** argv) std::cout << "GeoLocation.GPSTimeStamp " << imageEXIF.GeoLocation.GPSTimeStamp << "\n"; if (!imageEXIF.GeoLocation.GPSDateStamp.empty()) std::cout << "GeoLocation.GPSDateStamp " << imageEXIF.GeoLocation.GPSDateStamp << "\n"; + if (imageEXIF.GPano.hasPosePitchDegrees()) + std::cout << "GPano.PosePitchDegrees " << imageEXIF.GPano.PosePitchDegrees << "\n"; + if (imageEXIF.GPano.hasPoseRollDegrees()) + std::cout << "GPano.PoseRollDegrees " << imageEXIF.GPano.PoseRollDegrees << "\n"; return EXIT_SUCCESS; }