mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-06-22 22:39:10 -04:00
Resolution calculations performed by functions
Added functions for dpi <-> ppm transformations and used in all plugins.
This commit is contained in:
@@ -216,7 +216,7 @@ public:
|
||||
auto v = QString::fromLatin1(pchar_t(res.data()), res.size()).toDouble(&ok);
|
||||
if (ok && v > 0) {
|
||||
if (m_pb._unitsOfMeasurement) { // Inches
|
||||
return qRoundOrZero(width() / v / 25.4 * 1000);
|
||||
return dpi2ppm(width() / v);
|
||||
}
|
||||
// Millimeters
|
||||
return qRoundOrZero(width() / v * 1000);
|
||||
@@ -230,7 +230,7 @@ public:
|
||||
auto v = QString::fromLatin1(pchar_t(res.data()), res.size()).toDouble(&ok);
|
||||
if (ok && v > 0) {
|
||||
if (m_pb._unitsOfMeasurement) { // Inches
|
||||
return qRoundOrZero(height() / v / 25.4 * 1000);
|
||||
return dpi2ppm(height() / v);
|
||||
}
|
||||
// Millimeters
|
||||
return qRoundOrZero(height() / v * 1000);
|
||||
|
||||
Reference in New Issue
Block a user