[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:38:08 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=b7e73a2

The following commit has been merged in the master branch:
commit b7e73a2090f52a2e1ebea78506232004d9ded9df
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Nov 26 15:40:41 2006 +0000

    Improved pretty-print function for degrees.
---
 src/tags.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/tags.cpp b/src/tags.cpp
index ba9b5bb..e73b739 100644
--- a/src/tags.cpp
+++ b/src/tags.cpp
@@ -1609,15 +1609,19 @@ namespace Exiv2 {
         if (value.count() == 3) {
             std::ostringstream oss;
             oss.copyfmt(os);
-            static const char unit[4] = "'\"";
+            static const char* unit[] = { "deg", "'", "\"" };
+            static const int prec[] = { 7, 5, 3 };
             int n;
             for (n = 2; n > 0; --n) {
                 if (value.toRational(n).first != 0) break;
             }
-            for (int i = 0; i < n + 1; ++i) {
+            for (int i = 0; i < n + 1; ++i) {                
+                const int32_t z = value.toRational(i).first;
                 const int32_t d = value.toRational(i).second;
-                const int p = d > 1 ? d > 19 ? d > 199 ? d > 1999 ? 4 : 3 : 2 : 1 : 0;
-                os << std::fixed << std::setprecision(p) << value.toFloat(i)
+                // Hack: Need Value::toDouble
+                double b = static_cast<double>(z)/d;
+                const int p = z % d == 0 ? 0 : prec[i];
+                os << std::fixed << std::setprecision(p) << b
                    << unit[i] << " ";
             }
             os.copyfmt(oss);

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list