I would like to know what am I doing wrong with this code :
if self.digital:
im = Image.open(os.path.join(folder, filename))
width, height = im.size
image_info["width"] = round(width / 37.79527559055, 0)
I would like to use this code to convert the pixel size of a picture into centimeters, but I don't understand why it returns me this issue :
Python311\Lib\site-packages\PIL\Image.py:3167: DecompressionBombWarning: Image size (130437549 pixels) exceeds limit of 89478485 pixels, could be decompression bomb DOS attack.
I don't want to use DPI, in my script 1cm = 37.79527559055 pixels.
I'm going to use a temporary list to write pixels value in then convert but I would like to know if there is a faster way or not, and why exactly is it making a zip bomb.
Thanks !