]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/jpeg/ExifGateway.java
Version 15.2, November 2013
[GpsPrune.git] / tim / prune / jpeg / ExifGateway.java
index 9fefadf33c78003248e12e119481346c667166d6..c11ba2e69ec7c3f1d7ead5bd7a549ec3ea6ce318 100644 (file)
@@ -47,7 +47,10 @@ public abstract class ExifGateway
                                return data;
                        }
                }
-               catch (LinkageError nolib) {}
+               catch (LinkageError nolib) {
+                       System.err.println("Link: " + nolib.getMessage());
+                       nolib.printStackTrace();
+               }
                // Not successful - warn if necessary
                if (!_exifFailWarned)
                {
@@ -69,7 +72,6 @@ public abstract class ExifGateway
        }
 
 
-
        /**
         * @param inNumerator numerator from Rational
         * @param inDenominator denominator from Rational
@@ -88,4 +90,19 @@ public abstract class ExifGateway
                if (inDenominator < 0) denomDbl += correction;
                return numeratorDbl / denomDbl;
        }
+
+
+       /**
+        * @param inNumerator numerator from Rational
+        * @param inDenominator denominator from Rational
+        * @return the value of the specified number as a positive <code>double</code>.
+        * Forces a positive answer
+        */
+       public static final double convertToPositiveValue(long inNumerator, long inDenominator)
+       {
+               if (inDenominator == 0L) return 0.0;
+               final double numeratorDbl = inNumerator;
+               final double denomDbl = inDenominator;
+               return numeratorDbl / denomDbl;
+       }
 }