tiff_write_meta

lib.image.tiff_write_meta(image: bytes, data: PNGHeader | dict[str, Any] | bytes) bytes

Write Faceswap information to a tiff’s image_description field.

Parameters:
  • png – The bytes encoded tiff file to write header data to

  • data (PNGHeader | dict[str, Any] | bytes) – The data to write to the image-description field. If provided as a dict, then it should be a json serializable object, otherwise it should be data encoded as ascii bytes

  • image (bytes)

Return type:

bytes

Notes

This handles a very specific task of adding, and populating, an ImageDescription field in a Tiff file generated by OpenCV. For any other use cases it will likely fail