def save(self, fileobj, format): format_object = get_format(format) if not format_object: raise FormatNotSupported(format) format_object.save(self, fileobj)
def open(cls, fileobj): for format in get_format_objects(): image = format.open(fileobj) if image: return image raise FormatNotSupported()
def encode(image, fileobj): raise FormatNotSupported('jpeg')