From b5c2f63c4108148c41064c74cb4a07d63c595351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Sat, 23 Sep 2023 08:10:33 -0300 Subject: [PATCH] Made Orientation use a text display instead of a number. --- lib/tlIO/RAW.h | 1 + lib/tlIO/RAWRead.cpp | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/tlIO/RAW.h b/lib/tlIO/RAW.h index 1fccc9423..2200087b4 100644 --- a/lib/tlIO/RAW.h +++ b/lib/tlIO/RAW.h @@ -48,6 +48,7 @@ namespace tl const std::weak_ptr&); protected: + const char* _getOrientation(int flip); io::Info _getInfo( const std::string& fileName, const file::MemoryRead*) override; diff --git a/lib/tlIO/RAWRead.cpp b/lib/tlIO/RAWRead.cpp index 6d1d0635b..6f9339250 100644 --- a/lib/tlIO/RAWRead.cpp +++ b/lib/tlIO/RAWRead.cpp @@ -115,7 +115,7 @@ namespace tl else if(color.model2[0]) tags["Software"] = color.model2; - _getTag("Orientation", sizes.flip); + _getTag("Orientation", _getOrientation(sizes.flip)); _getTag("ISO Speed Ratings", other.iso_speed); _getTag("Exposure Time", other.shutter); _getTag("Shutter Speed Value", @@ -337,6 +337,23 @@ namespace tl return out; } + const char* Read::_getOrientation(int flip) + { + switch(sizes.flip) + { + case 5: // 90 deg counter clockwise + return "90 Degrees Counter Clockwise"; + case 6: // 90 deg clockwise + return "90 Degrees Clockwise"; + case 0: // no rotation + return "No Rotation"; + case 3: // 180 degree rotation + return "180 degree rotation"; + default: + return "Unknown"; + } + } + io::Info Read::_getInfo( const std::string& fileName, const file::MemoryRead* memory)