private String getPhotometricInterpreterString(final TiffDirectory directory, final int[] bitsPerSample) throws ImagingException {
        final int photometricInterpretation = 0xffff & directory.getFieldValue(TiffTagConstants.TIFF_TAG_PHOTOMETRIC_INTERPRETATION);

        switch (photometricInterpretation) {
        case 0:
            return "BiLev Inv";
        case 1:
            return "BiLevel";
        case 2:
            String a = "RGB";
            if (bitsPerSample.length == 4) {
                final Object o = directory.getFieldValue(TiffTagConstants.TIFF_TAG_EXTRA_SAMPLES);
                short extraSamples = 0;
                if (o instanceof Short) {
                    extraSamples = (Short) o;
                }
                if (extraSamples == 1) {
                    a = "RGB Pre-A";
                } else {
                    a = "RGBA";
                }
            }

            return a;
        case 3:
            return "Palette";

        case 5: // CMYK
            return "CMYK";
        case 6:
            return "YCbCr";
        case 8:
            return "CieLab";

        case 32844:
        case 32845:
            return "LogLuv";
        default:
            return "Unknown";

        }

    }
Formats a header allowing space for the maximum length of the file paths in the list. If the comma-separated-value option is set, spaces will be
suppressed and commas introduced as separators.

@param maxPathLen the maximum length of a file path (used if csv option is not set)
@param csv        true if formatting is configured for comma-separated-value files.
@return a valid string.
src/test/java/org/apache/commons/imaging/examples/tiff/SurveyTiffFile.java