tiffcomment

tifffile.tiffcomment(arg, /, comment=None, pageindex=None, tagcode=None)

Return or replace ImageDescription value in first page of TIFF file.

Parameters:
  • arg (str | os.PathLike[Any] | FileHandle | IO[bytes]) – Specifies TIFF file to open.

  • comment (str | bytes | None) – 7-bit ASCII string or bytes to replace existing tag value. The existing value is zeroed.

  • pageindex (int | None) – Index of page which ImageDescription tag value to read or replace. The default is 0.

  • tagcode (int | str | None) – Code of tag which value to read or replace. The default is 270 (ImageDescription).

Returns:

None, if comment is specified. Else, the current value of the specified tag in the specified page.

Return type:

str | None