summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/image-resolution.cpp
diff options
context:
space:
mode:
authorLiam P. White <inkscapebronyat-signgmaildotcom>2014-04-12 05:09:04 +0000
committerLiam P. White <inkscapebronyat-signgmaildotcom>2014-04-12 05:09:04 +0000
commitaae590bbc1df602cebb53434718fc70267ffaf19 (patch)
tree73e2b63d910c0393629cbf0d37b1e7d464325d34 /src/extension/internal/image-resolution.cpp
parentWonderful code optimizations (diff)
parentLatvian translation update (diff)
downloadinkscape-aae590bbc1df602cebb53434718fc70267ffaf19.tar.gz
inkscape-aae590bbc1df602cebb53434718fc70267ffaf19.zip
Update to trunk
(bzr r13090.1.51)
Diffstat (limited to 'src/extension/internal/image-resolution.cpp')
-rw-r--r--src/extension/internal/image-resolution.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/extension/internal/image-resolution.cpp b/src/extension/internal/image-resolution.cpp
index 18eb97f80..f092b21ef 100644
--- a/src/extension/internal/image-resolution.cpp
+++ b/src/extension/internal/image-resolution.cpp
@@ -353,18 +353,13 @@ void ImageResolution::readmagick(char const *fn) {
g_warning("ImageResolution::readmagick: Unknown error");
return;
}
- Magick::Geometry geo = image.density();
- std::string type = image.magick();
-
- if (type == "PNG") { // PNG only supports pixelspercentimeter
- x_ = Inkscape::Util::Quantity::convert((double)geo.width(), "in", "cm");
- y_ = Inkscape::Util::Quantity::convert((double)geo.height(), "in", "cm");
- } else {
- x_ = (double)geo.width();
- y_ = (double)geo.height();
- }
- ok_ = true;
+ x_ = image.xResolution();
+ y_ = image.yResolution();
+
+ if (x_ != 0 && y_ != 0) {
+ ok_ = true;
+ }
}
#else