summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/image-resolution.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-09-25 22:56:32 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-09-25 22:56:32 +0000
commit86c5f57796d973a949bf784a2a3decd451670f65 (patch)
tree67ebaebe16b973bbec7bc3b5501dbfcd63477c8c /src/extension/internal/image-resolution.cpp
parentupdate to trunk (diff)
parentC++ify calling a few SPLPEItem functions, much more work than expected... slo... (diff)
downloadinkscape-86c5f57796d973a949bf784a2a3decd451670f65.tar.gz
inkscape-86c5f57796d973a949bf784a2a3decd451670f65.zip
Update to trunk
(bzr r11950.1.148)
Diffstat (limited to 'src/extension/internal/image-resolution.cpp')
-rw-r--r--src/extension/internal/image-resolution.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/extension/internal/image-resolution.cpp b/src/extension/internal/image-resolution.cpp
index a9d33e831..b38b0ddc7 100644
--- a/src/extension/internal/image-resolution.cpp
+++ b/src/extension/internal/image-resolution.cpp
@@ -11,6 +11,7 @@
# include <config.h>
#endif
+#include "util/units.h"
#include "image-resolution.h"
#define IR_TRY_PNG 1
@@ -341,15 +342,9 @@ void ImageResolution::readmagick(char const *fn) {
image.read(fn);
} catch (...) {}
Magick::Geometry geo = image.density();
- std::string type = image.magick();
-
- if (type == "PNG") { // PNG only supports pixelspercentimeter
- x_ = (double)geo.width() * 2.54;
- y_ = (double)geo.height() * 2.54;
- } else {
- x_ = (double)geo.width();
- y_ = (double)geo.height();
- }
+
+ x_ = Inkscape::Util::Quantity::convert((double)geo.width(), "pt", "px");
+ y_ = Inkscape::Util::Quantity::convert((double)geo.height(), "pt", "px");
ok_ = true;
}