Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate ImageCms constants and versions() function #7702

Merged
merged 7 commits into from
Jan 11, 2024

Conversation

nulano
Copy link
Contributor

@nulano nulano commented Jan 8, 2024

Deprecations proposed in this pull request:

  • DESCRIPTION is just a subset of the information in the docs/changelog and can be removed after deprecation.
  • VERSION has been equal to "1.0.0 pil" since 2013, PIL.__version__ should be used instead.
  • FLAGS is based on LCMS1, Flags added in Add LCMS2 flags to ImageCms #7676 uses names from LCMS2.
  • versions() is undocumented and returns values already available elsewhere.

@@ -32,7 +34,7 @@

_imagingcms = DeferredError.new(ex)

DESCRIPTION = """
_DESCRIPTION = """
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When removing this constant, is there any important info in this text we should keep somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally released under LGPL. Graciously donated to PIL in
March 2009, for distribution under the standard PIL license

This should probably be turned into a comment - I've pushed a commit.

There are also links to https://www.cazabon.com/pyCMS and https://www.littlecms.com. I'm not sure these need to be kept; https://www.cazabon.com/pyCMS is the first result I get on Google for "Kevin Cazabon's PyCMS library" in a private window.

Otherwise, it just duplicates information from comments in ImageCms.py, text from ImageCms.rst, and part of CHANGES.rst for PIL 1.1.7c1.

docs/releasenotes/10.3.0.rst Outdated Show resolved Hide resolved
``ImageCms.VERSION`` ``PIL.__version__``
``ImageCms.FLAGS["MATRIXINPUT"]`` :py:attr:`.ImageCms.Flags.CLUT_POST_LINEARIZATION`
``ImageCms.FLAGS["MATRIXOUTPUT"]`` :py:attr:`.ImageCms.Flags.FORCE_CLUT`
``ImageCms.FLAGS["MATRIXONLY"]``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No replacement for this?

Copy link
Contributor Author

@nulano nulano Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is equal to (1 | 2) i.e. (MATRIXINPUT | MATRIXOUTPUT), so it could be CLUT_POST_LINEARIZATION | FORCE_CLUT, but from the flag names it looks like these values have been repurposed in LCMS2.

I wasn't even sure about listing the replacements for MATRIXINPUT and MATRIXOUTPUT, but I couldn't find any LCMS2 documentation on this and didn't feel like hunting around in LCMS2 source code to check for each flag, so I just matched all flags by their values.

@hugovk hugovk added the Deprecation Feature that will be removed in the future label Jan 8, 2024
Tests/test_imagecms.py Outdated Show resolved Hide resolved
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
@hugovk hugovk merged commit 5baace9 into python-pillow:main Jan 11, 2024
57 checks passed
@hugovk
Copy link
Member

hugovk commented Jan 11, 2024

Thanks!

@nulano nulano deleted the deprecate-cms-constants branch January 11, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecation Feature that will be removed in the future
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants