classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Patch: compute aspect ratios with fp division


From: Anthony Green
Subject: [cp-patches] Patch: compute aspect ratios with fp division
Date: Wed, 14 Sep 2005 17:48:34 -0700

Another integer division problem.  OK?

AG
 

2005-09-14  Anthony Green  <address@hidden>

        * javax/imageio/ImageReader.java (getAspectRatio): Don't use
        integer division when computing aspect ratio.


Index: javax/imageio/ImageReader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/imageio/ImageReader.java,v
retrieving revision 1.5
diff -u -r1.5 ImageReader.java
--- javax/imageio/ImageReader.java      2 Jul 2005 20:32:45 -0000       1.5
+++ javax/imageio/ImageReader.java      15 Sep 2005 00:00:52 -0000
@@ -126,7 +126,7 @@
   public float getAspectRatio(int imageIndex)
     throws IOException
   {
-    return (float) (getWidth(imageIndex) / getHeight(imageIndex));
+      return ((float) getWidth(imageIndex)) / ((float) getHeight(imageIndex));
   }
 
   public Locale[] getAvailableLocales()






reply via email to

[Prev in Thread] Current Thread [Next in Thread]