Closed stefan6419846 closed 2 months ago
There is an upstream fix available as a PR for the next Pillow release which fixes this.
This slightly breaks test_filters.test_rgba
and test_workflows.py.test_image_extraction[https://corpora.tika.apache.org/base/docs/govdocs1/972/972174.pdf-tika-972174.pdf]
, but this can be fixed by setting ImageFile.LOAD_TRUNCATED_IMAGES = True
for the scope of the corresponding test method.
I am not sure whether we should ban Pillow==10.3.0
from pypdf for now or whether we consider this an issue which does not occur too often and have no control over it anyway. From my perspective, I would probably not restrict this for now.
@stefan6419846 can you confirm that the transparency is correct?
@pubpub-zz The alpha masking is done in a separate step and looks correct.
This is the newly rendered image after applying the patch:
The file size differs slightly, but I could not see any real visual difference when comparing it to the reference image.
Finally Pillow 10.4 has been released! 🎉🎉🎉 https://github.com/python-pillow/Pillow/releases/tag/10.4.0 the test now works. We should close this issue
I just did a standalone custom CI run with version 10.4.0 and it is working fine now.
Should we upgrade to 10.4 ?
If ever, we should disallow 10.3.0. Upgrading our CI does not work as we would have to drop Python 3.7 for this.
Running the tests with
Pillow==10.3.0
breakstest_filters.test_rgba
.Pillow==10.2.0
works correctly.Environment
Which environment were you using when you encountered the problem?
Code + PDF
Just run
pytest -k 'test_rgba'
.Expected image:
Actual image:
Traceback
This is the complete traceback I see: