def read(cls, fp, **kwargs): id = read_fmt('H', fp)[0] try: id = ColorSpaceID(id) except ValueError: logger.info('Custom color space found: %d' % (id)) if id == ColorSpaceID.LAB: values = read_fmt('4h', fp) else: values = read_fmt('4H', fp) return cls(id, list(values))