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

Method write_string

src/PIL/TiffImagePlugin.py:821–827  ·  view source on GitHub ↗
(self, value: str | bytes | int)

Source from the content-addressed store, hash-verified

819
820 @_register_writer(2)
821 def write_string(self, value: str | bytes | int) -> bytes:
822 # remerge of https://github.com/python-pillow/Pillow/pull/1416
823 if isinstance(value, int):
824 value = str(value)
825 if not isinstance(value, bytes):
826 value = value.encode("ascii", "replace")
827 return value + b"\0"
828
829 @_register_loader(5, 8)
830 def load_rational(

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected