public int getIntValueOrArraySum() throws ImagingException {
        final Object o = getValue();
        // if (o == null)
        // return -1;

        if (o instanceof Number) {
            return ((Number) o).intValue();
        }
        if (o instanceof Number[]) {
            final Number[] numbers = (Number[]) o;
            int sum = 0;
            for (final Number number : numbers) {
                sum += number.intValue();
            }
            return sum;
        }
        if (o instanceof short[]) {
            final short[] numbers = (short[]) o;
            int sum = 0;
            for (final short number : numbers) {
                sum += number;
            }
            return sum;
        }
        if (o instanceof int[]) {
            final int[] numbers = (int[]) o;
            int sum = 0;
            for (final int number : numbers) {
                sum += number;
            }
            return sum;
        }

        throw new ImagingException("Unknown value: " + o + " for: " + getTagInfo().getDescription());
        // return -1;
    }
Returns the field's type, derived from bytes 2-3.

@return the field's type, as a {@code FieldType} object.
src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java