A similar (untested) patch for PNG. I do not know whether TIFF needs similar 
logic.

Index: com/lowagie/text/pdf/codec/PngImage.java
===================================================================
RCS file: 
/usr/local/cvsroot/nexposev4/src/3rdparty/itext/itext/java/com/lowagie/text/pdf/codec/PngImage.java,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 PngImage.java
--- com/lowagie/text/pdf/codec/PngImage.java    6 Jun 2007 23:09:56 -0000       
1.1.1.5
+++ com/lowagie/text/pdf/codec/PngImage.java    27 Jun 2007 21:50:03 -0000
@@ -346,8 +346,8 @@
                 int dy = getInt(is);
                 int unit = is.read();
                 if (unit == 1) {
-                    dpiX = (int)((float)dx * 0.0254f);
-                    dpiY = (int)((float)dy * 0.0254f);
+                    dpiX = Math.round((float)dx * 0.0254f);
+                    dpiY = Math.round((float)dy * 0.0254f);
                 }
                 else {
                     if (dy != 0)

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to