Example usage for org.apache.commons.imaging.formats.tiff TiffField getIntValue

List of usage examples for org.apache.commons.imaging.formats.tiff TiffField getIntValue

Introduction

In this page you can find the example usage for org.apache.commons.imaging.formats.tiff TiffField getIntValue.

Prototype

public int getIntValue() throws ImageReadException 

Source Link

Usage

From source file:net.mozq.picto.core.ProcessCore.java

private static Integer getEXIFIntValue(ImageMetadata imageMetadata, TagInfo tagInfo) {
    TiffField field = getTiffField(imageMetadata, tagInfo);
    if (field == null) {
        return null;
    }//from  w  w w  .  j a v a  2 s  . c  o  m

    Integer value;
    try {
        value = Integer.valueOf(field.getIntValue());
    } catch (ImageReadException e) {
        value = null;
    }

    return value;
}

From source file:net.tourbook.photo.Photo.java

private int getExifValueInt(final JpegImageMetadata jpegMetadata, final TagInfo tiffTag,
        final int defaultValue) {

    try {// w  ww.  j a  v  a  2  s . c o  m
        final TiffField field = jpegMetadata.findEXIFValueWithExactMatch(tiffTag);
        if (field != null) {
            return field.getIntValue();
        }
    } catch (final Exception e) {
        // ignore
    }

    return defaultValue;
}

From source file:net.tourbook.photo.Photo.java

private int getTiffValueInt(final TiffImageMetadata tiffMetadata, final TagInfoShortOrLong tiffTag,
        final int defaultValue) {

    try {//from   ww  w  . j av a2 s .c  om
        final TiffField field = tiffMetadata.findField(tiffTag, true);
        if (field != null) {
            return field.getIntValue();
        }
    } catch (final Exception e) {
        // ignore
    }

    return defaultValue;
}