-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
What did you do?
-
Download example EMF file
test_libuemf_ref.emffrom https://bugs.documentfoundation.org/attachment.cgi?id=135791 (via https://bugs.documentfoundation.org/show_bug.cgi?id=55058) -
Run:
import PIL.Image
with PIL.Image.open("test_libuemf_ref.emf") as im:
im.save("out.png")What did you expect to happen?
out.png should be created.
What actually happened?
C:\Python311\Lib\site-packages\PIL\Image.py:3167: DecompressionBombWarning: Image size (139177600 pixels) exceeds limit of 89478485 pixels, could be decompression bomb DOS attack.
warnings.warn(
{'wmf_bbox': (0, 0, 14030, 9920), 'dpi': (1199.9124549648136, 1199.9047573693986)}
Traceback (most recent call last):
File "test.py", line 3, in <module>
im.save("test_libuemf_ref.emf")
File "C:\Python311\Lib\site-packages\PIL\Image.py", line 2394, in save
self._ensure_mutable()
File "C:\Python311\Lib\site-packages\PIL\Image.py", line 611, in _ensure_mutable
self._copy()
File "C:\Python311\Lib\site-packages\PIL\Image.py", line 604, in _copy
self.load()
File "C:\Python311\Lib\site-packages\PIL\WmfImagePlugin.py", line 162, in load
return super().load()
^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\PIL\ImageFile.py", line 345, in load
image = loader.load(self)
^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\PIL\WmfImagePlugin.py", line 53, in load
Image.core.drawwmf(im.fp.read(), im.size, self.bbox),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: cannot render metafileWhat are your OS, Python and Pillow versions?
- OS: Windows 10
- Python: 3.11
- Pillow: 9.4.0