Skip to content

SVG Images break #3

Description

@chahu

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'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions