Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Add typing information to ImageCmsProfile, and deprecate product_name/product_info

Open lukegb opened this issue 6 months ago • 1 comments

The _set method is no longer necessary, since we no longer compute any attributes from the profile. In most cases, we only set the profile, and in only one branch do we set the filename to anything non-None.

product_name/product_info were set to None at some point during what appears to be a batch of changes for Python 3 compatibility (ce041fd1995fe95de86804c83d100ed7d8ecdb3b), and never set back. Given this, let's deprecate these and schedule them for removal in Pillow 13.

Changes proposed in this pull request:

  • Add attribute typing to ImageCmsProfile
  • Deprecate ImageCms.ImageCmsProfile.product_name, ImageCms.ImageCmsProfile.product_info
  • Deprecate ImageCms.ImageCmsProfile._set

lukegb avatar Jun 03 '25 11:06 lukegb

  • Deprecate ImageCms.ImageCmsProfile._set

This is an undocumented underscore method, so not part of the public API and can be changed/removed without deprecation.

https://pillow.readthedocs.io/en/stable/reference/ImageCms.html

hugovk avatar Jun 08 '25 17:06 hugovk

I've created https://github.com/python-pillow/Pillow/pull/9032, to move forward with part of this at least.

radarhere avatar Jun 22 '25 11:06 radarhere