]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagpng.cpp
Added missing URL attribute testing
[wxWidgets.git] / src / common / imagpng.cpp
index 8acc531db200c93799993c2cb59546d5f06dd702..bb081b809a5e532d0679a7854c43bdb5e7163e33 100644 (file)
@@ -63,8 +63,6 @@ enum Transparency
     Transparency_Alpha
 };
 
-static const double INCHES_IN_METER = 39.3700787;
-
 // ----------------------------------------------------------------------------
 // local functions
 // ----------------------------------------------------------------------------
@@ -755,8 +753,11 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos
     switch ( GetResolutionFromOptions(*image, &resX, &resY) )
     {
         case wxIMAGE_RESOLUTION_INCHES:
-            resX *= INCHES_IN_METER;
-            resY *= INCHES_IN_METER;
+            {
+                const double INCHES_IN_METER = 10000.0 / 254;
+                resX = int(resX * INCHES_IN_METER);
+                resY = int(resY * INCHES_IN_METER);
+            }
             break;
 
         case wxIMAGE_RESOLUTION_CM: