[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:45:37 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=02d6f84
The following commit has been merged in the master branch:
commit 02d6f8460a0d85c81039a04199698a7b98e4e7ca
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Mon Aug 24 11:17:43 2015 +0000
#935: Fixed ExposureTime pretty-print function.
---
src/tags.cpp | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/src/tags.cpp b/src/tags.cpp
index 8d8b9c4..fcedb5d 100644
--- a/src/tags.cpp
+++ b/src/tags.cpp
@@ -2463,22 +2463,23 @@ namespace Exiv2 {
std::ostream& print0x829a(std::ostream& os, const Value& value, const ExifData*)
{
- Rational t = value.toRational();
- if (t.first > 1 && t.second > 1 && t.second >= t.first) {
- t.second = static_cast<uint32_t>(
- static_cast<float>(t.second) / t.first + 0.5);
- t.first = 1;
+ if (value.count() == 0) return os;
+ if (value.typeId() != unsignedRational) return os << "(" << value << ")";
+
+ URational t = value.toRational();
+ if (t.first == 0 || t.second == 0) {
+ os << "(" << t << ")";
}
- if (t.second > 1 && t.second < t.first) {
- t.first = static_cast<uint32_t>(
- static_cast<float>(t.first) / t.second + 0.5);
- t.second = 1;
+ else if (t.second == t.first) {
+ os << "1 s";
}
- if (t.second == 1) {
- os << t.first << " s";
+ else if (t.second % t.first == 0) {
+ t.second = t.second / t.first;
+ t.first = 1;
+ os << t << " s";
}
else {
- os << t.first << "/" << t.second << " s";
+ os << static_cast<float>(t.first) / t.second << " s";
}
return os;
}
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list