Example usage for org.apache.commons.imaging.formats.tiff.fieldtypes FieldType SHORT

List of usage examples for org.apache.commons.imaging.formats.tiff.fieldtypes FieldType SHORT

Introduction

In this page you can find the example usage for org.apache.commons.imaging.formats.tiff.fieldtypes FieldType SHORT.

Prototype

FieldTypeShort SHORT

To view the source code for org.apache.commons.imaging.formats.tiff.fieldtypes FieldType SHORT.

Click Source Link

Usage

From source file:joachimeichborn.geotag.io.jpeg.PictureMetadataReader.java

private int[] getTagIntValue(final TagInfo aTagInfo) {
    if (jpegMetadata != null) {
        final TiffField field = jpegMetadata.findEXIFValueWithExactMatch(aTagInfo);
        if (field != null) {
            final FieldType fieldType = field.getFieldType();
            if (fieldType.getType() == FieldType.SHORT.getType()) {
                try {
                    return field.getIntArrayValue();
                } catch (ImageReadException e) {
                    logger.fine("Failed to read " + aTagInfo + " from " + pictureFile + ": " + e.getMessage());
                }//ww  w.j  a va  2  s  .c  o  m
            }
        }
    }
    return null;
}