I want to do a very simple operation: I want to save .emf
files into .png
. To do so I do:
from PIL import Image
import PIL
path_img = './' + title + ".png"
Image.open(file).save(path_img)
This has always worked. However, today I encountered an image that exceeds the pixel limit:
PIL.Image.DecompressionBombError: Image size (933120000 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.
So I read this on SoF which suggests to do the following:
Image.MAX_IMAGE_PIXELS = None
However, when I do this I got the following error:
Canceled future for execute_request message before replies were done The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details.
I do not understand why I got it. I read that this is typically due to incorrectly installed packages. Indeed, I tried to do upgrade the Pillow package with pip but it did not work.
Does anyone know how to handle this issue?