code: private void CheckRGBImage(IfdTags metadata, int n) {
      // Samples per Pixel
      long samples = metadata.get(TiffTags.getTagId("SamplesPerPixel")).getFirstNumericValue();
      if (samples < 3)
        validation.addError("Invalid Samples per Pixel", "IFD" + n, samples);
  
      // Compression
      long comp = metadata.get(TiffTags.getTagId("Compression")).getFirstNumericValue();
      // if (comp != 1 && comp != 32773)
      if (comp < 1)
        validation.addError("Invalid Compression", "IFD" + n, comp);
    }
docs: Check RGB Image.
  
  @param metadata the metadata
  @param n the IFD number