MCPcopy Index your code
hub / github.com/python-pillow/Pillow / encode

Method encode

src/PIL/ImageFile.py:896–906  ·  view source on GitHub ↗

Override to perform the encoding process. :param bufsize: Buffer size. :returns: A tuple of ``(bytes encoded, errcode, bytes)``. If finished with encoding return 1 for the error code. Err codes are from :data:`.ImageFile.ERRORS`.

(self, bufsize: int)

Source from the content-addressed store, hash-verified

894 return self._pushes_fd
895
896 def encode(self, bufsize: int) -> tuple[int, int, bytes]:
897 """
898 Override to perform the encoding process.
899
900 :param bufsize: Buffer size.
901 :returns: A tuple of ``(bytes encoded, errcode, bytes)``.
902 If finished with encoding return 1 for the error code.
903 Err codes are from :data:`.ImageFile.ERRORS`.
904 """
905 msg = "unavailable in base encoder"
906 raise NotImplementedError(msg)
907
908 def encode_to_pyfd(self) -> tuple[int, int]:
909 """

Callers 15

test_encodeMethod · 0.95
encode_to_pyfdMethod · 0.95
encode_to_fileMethod · 0.95
_saveFunction · 0.45
_saveFunction · 0.45
_get_global_headerFunction · 0.45
_encode_tileFunction · 0.45
__init__Method · 0.45
_setitemMethod · 0.45
write_stringMethod · 0.45
write_undefinedMethod · 0.45
_saveFunction · 0.45

Calls

no outgoing calls

Tested by 1

test_encodeMethod · 0.76