def _validate_j2k_colorspace(self, cparams, colorspace):
if cparams.codec_fmt == opj2.CODEC_J2K and colorspace is not None:<EOL><INDENT>msg = '<STR_LIT>'<EOL>raise IOError(msg)<EOL><DEDENT>
Cannot specify a colorspace with J2K.