commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1325112 - /commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngImageParser.java
Date Thu, 12 Apr 2012 03:41:07 GMT
Author: damjan
Date: Thu Apr 12 03:41:07 2012
New Revision: 1325112

URL: http://svn.apache.org/viewvc?rev=1325112&view=rev
Log:
Fix reading DPI for PNG files.

Jira issue key: SANSELAN-69
Submitted by: VVD <vvd at pochta dot ru>


Modified:
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngImageParser.java

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngImageParser.java?rev=1325112&r1=1325111&r2=1325112&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngImageParser.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngImageParser.java
Thu Apr 12 03:41:07 2012
@@ -627,12 +627,12 @@ public class PngImageParser extends Imag
                         .round(pngChunkpHYs.PixelsPerUnitXAxis
                                 * meters_per_inch);
                 PhysicalWidthInch = (float) ((double) Width
-                        * (double) pngChunkpHYs.PixelsPerUnitXAxis * meters_per_inch);
+                        / ((double) pngChunkpHYs.PixelsPerUnitXAxis * meters_per_inch));
                 PhysicalHeightDpi = (int) Math
                         .round(pngChunkpHYs.PixelsPerUnitYAxis
                                 * meters_per_inch);
                 PhysicalHeightInch = (float) ((double) Height
-                        * (double) pngChunkpHYs.PixelsPerUnitYAxis * meters_per_inch);
+                        / ((double) pngChunkpHYs.PixelsPerUnitYAxis * meters_per_inch));
             }
 
             String FormatDetails = "Png";



Mime
View raw message