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

Improved image lifecycle documentation #5773

Merged
merged 3 commits into from Oct 17, 2021
Merged

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Oct 16, 2021

Resolves #5772 by improving the image lifecycle documentation.

  • Copied images are not associated with the original file
  • __exit__ does not destroy the core image object

    Pillow/src/PIL/Image.py

    Lines 579 to 585 in fa53b71

    def __exit__(self, *args):
    if hasattr(self, "fp") and getattr(self, "_exclusive_fp", False):
    if hasattr(self, "_close__fp"):
    self._close__fp()
    if self.fp:
    self.fp.close()
    self.fp = None

@radarhere radarhere changed the title Copied images are not associated with the original file Improved image lifecycle documentation Oct 16, 2021
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Copy link

@jenstroeger jenstroeger left a comment

Choose a reason for hiding this comment

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

Great, thank you!

@hugovk hugovk merged commit 174fad7 into python-pillow:main Oct 17, 2021
@radarhere radarhere deleted the copy branch October 17, 2021 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve lifecycle documentation
3 participants