pptx-downsizer icon indicating copy to clipboard operation
pptx-downsizer copied to clipboard

SVG Images break

Open chahu opened this issue 3 years ago • 0 comments

I believe PIL doesn't support svg images which is why a pptx with an svg will fail. Probably better to skip the file if it's unsupported rather than die with an exception.

Traceback (most recent call last):
  File "/home/chahu/.local/bin/pptx-downsizer", line 8, in <module>
    sys.exit(cli())
  File "/home/chahu/.local/lib/python3.10/site-packages/pptx_downsizer/pptx_downsizer.py", line 466, in cli
    downsize_pptx_images(**params)
  File "/home/chahu/.local/lib/python3.10/site-packages/pptx_downsizer/pptx_downsizer.py", line 147, in downsize_pptx_images
    img = Image.open(imgfn)
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 3008, in open
    raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file '/tmp/tmpwp8xphkm/ppt/media/image16.svg'

chahu avatar Nov 22 '22 21:11 chahu