Java Code Examples for com.drew.lang.Rational#intValue()

The following examples show how to use com.drew.lang.Rational#intValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExifDescriptorBase.java    From metadata-extractor with Apache License 2.0 5 votes vote down vote up
@Nullable
public String getCompressedAverageBitsPerPixelDescription()
{
    Rational value = _directory.getRational(TAG_COMPRESSED_AVERAGE_BITS_PER_PIXEL);
    if (value == null)
        return null;
    String ratio = value.toSimpleString(_allowDecimalRepresentationOfRationals);
    return value.isInteger() && value.intValue() == 1
        ? ratio + " bit/pixel"
        : ratio + " bits/pixel";
}
 
Example 2
Source File: NikonType2MakernoteDescriptor.java    From metadata-extractor with Apache License 2.0 5 votes vote down vote up
@Nullable
public String getDigitalZoomDescription()
{
    Rational value = _directory.getRational(TAG_DIGITAL_ZOOM);
    if (value==null)
        return null;
    return value.intValue() == 1
            ? "No digital zoom"
            : value.toSimpleString(true) + "x digital zoom";
}