From fbd80d77d08c63a1e7ad0c3d4701fc1493d0b0bc Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Mon, 17 Aug 2015 02:43:57 +0200 Subject: import images with dpi from file : xscale and yscale were not rounded but floored, which resulted in 0 values for big images, and numerical mayhem ensued ("inf" and "nan"). Fixed bugs: - https://launchpad.net/bugs/1479193 (bzr r14307) --- src/extension/internal/gdkpixbuf-input.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/extension/internal/gdkpixbuf-input.cpp') diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index f5fab1fa2..f99c9050d 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -86,8 +86,8 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri) ir = new ImageResolution(uri); } if (ir && ir->ok()) { - xscale = 960.0 / floor(10.*ir->x() + .5); // round-off to 0.1 dpi - yscale = 960.0 / floor(10.*ir->y() + .5); + xscale = 960.0 / round(10.*ir->x() + .5); // round-off to 0.1 dpi + yscale = 960.0 / round(10.*ir->y() + .5); } else { xscale = 96.0 / defaultxdpi; yscale = 96.0 / defaultxdpi; -- cgit v1.2.3