Close file pointer copy in the libtiff encoder if still open#6986
Close file pointer copy in the libtiff encoder if still open#6986radarhere merged 3 commits intopython-pillow:mainfrom
Conversation
|
Hi @fcarron - I opened #6985 (comment) 2 minutes before you posted this merge request. I've made the same changes and this seems to have resolved the issue in #6985 - in the test files I had provided as well. I can test this properly next week but thanks for submitting this. |
|
I presume, like the other reports we've received about this, that you're a Windows user? |
|
@radarhere Yes, exactly (sorry I forgot to mention that), |
|
Thanks. I've created fcarron#1 as a suggestion for a test to add, to help ensure that this change doesn't get broken again in the future. |
|
@radarhere Thank you for adding this test. |
|
Just to link, this PR is similar to #5946 |
Resolves #6985
Problem:
When saving many tiff files with compression="group4" I get the error OSError: [Errno 24] Too many open files (after ~8000 images)
Without compression="group4" it works fine.
This also happens when a new image is created on each iteration and with explicit close()
Changes proposed in this pull request:
The file pointer seems to be cloned by the libtiff library, but not freed at the end.
Closing to file pointer solve the problem for me.