SmileyChris / easy-thumbnails

Easy thumbnails for Django
http://easy-thumbnails.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
1.37k stars 312 forks source link

fix #563: remove work with context manager in source_generators.py #564

Closed pyanchesko closed 2 years ago

pyanchesko commented 3 years ago

563

jaap3 commented 3 years ago

I think this should be merged, the Pillow docs say the following about .close():

This operation will destroy the image core and release its memory. The image data will be unusable afterward.

This function is required to close images that have multiple frames or have not had their file read and closed by the load() method. See File Handling in Pillow for more information.

https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.close

It doesn't really make sense to have a method that returns unusable image data.