/** * Gets the value as a Rational. If there are more than 1 Rationals in this * value, gets the first one. This method should be used for tags of type * {@link #TYPE_RATIONAL} or {@link #TYPE_UNSIGNED_RATIONAL}. * * @param defaultValue the numerator of the Rational to return if tag's * value does not exist or cannot be converted to a Rational (the * denominator will be 1). * @return the tag's value as a Rational, or the defaultValue. */ public Rational getValueAsRational( long defaultValue ) { Rational defaultVal = new Rational( defaultValue, 1 ); return getValueAsRational( defaultVal ); }
/** * Gets the value as a Rational. If there are more than 1 Rationals in this * value, gets the first one. This method should be used for tags of type * {@link #TYPE_RATIONAL} or {@link #TYPE_UNSIGNED_RATIONAL}. * * @param defaultValue the numerator of the Rational to return if tag's * value does not exist or cannot be converted to a Rational (the * denominator will be 1). * @return the tag's value as a Rational, or the defaultValue. */ public Rational getValueAsRational( long defaultValue ) { Rational defaultVal = new Rational( defaultValue, 1 ); return getValueAsRational( defaultVal ); }
double speed = shutterSpeed.getValueAsRational( 0 ).toDouble(); Log.d( LOG_TAG, "speed: " + speed );