code: private void CheckCMYK(IfdTags metadata, int n) {
      // Samples per pixel
      if (!metadata.containsTagId(TiffTags.getTagId("SamplesPerPixel"))) {
        validation.addErrorLoc("Missing Samples Per Pixel", "IFD" + n);
      }
  
      // BitsPerSample
      if (!metadata.containsTagId(TiffTags.getTagId("BitsPerSample"))) {
        validation.addErrorLoc("Missing BitsPerSample", "IFD" + n);
      }
    }
docs: Check CMYK.
  
  @param metadata the metadata
  @param n the ifd number