[Okular-devel] [Bug 174447] tif files - print output is not scaled correctly
Brad Hards
bradh at frogmouth.net
Sat Nov 8 11:38:41 CET 2008
http://bugs.kde.org/show_bug.cgi?id=174447
--- Comment #4 from Brad Hards <bradh frogmouth net> 2008-11-08 11:38:41 ---
Hmm, tried to fix this (with several varieties of
---
/home/bradh/devel/kde-src/kdegraphics/okular/generators/tiff/generator_tiff.cpp
(revision 881437)
+++
/home/bradh/devel/kde-src/kdegraphics/okular/generators/tiff/generator_tiff.cpp
(working copy)
@@ -433,7 +433,9 @@
if ( i != 0 )
printer.newPage();
- p.drawImage( 0, 0, image );
+ QSize targetSize = printer.pageRect().size();
+
+ p.drawImage( 0, 0, image.scaled( targetSize, Qt::IgnoreAspectRatio,
Qt::SmoothTransformation ) );
}
return true;
It now fits on the page, and the example that Ferdinand provided looks fine.
However I'm not sure it is always going to be right - perhaps will usually look
OK if it really came from a printed page, but maybe need to deal with the
variable X and Y resolution in some smarter way.
Also, I'm not sure if the image should be drawn at pageRect().topLeft() or at
(0,0).
Pino: any thoughts?
--
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Okular-devel
mailing list