kyamagu / psd2svg

PSD to SVG converter.
MIT License
52 stars 17 forks source link

"IOError: cannot write mode CMYK as PNG" when trying to convert a psd to svg #28

Closed brunetton closed 4 years ago

brunetton commented 4 years ago

Hi,

I run accross this error converting a psd to svg. I suppose this psd file contains raster images that are converted to png. I'd like to have an option to disable raster convertion; as in this precise case I only need some vector parts.

Traceback (most recent call last):
  File "/home/bruno/.local/bin/psd2svg", line 10, in <module>
    sys.exit(main())
  File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/__main__.py", line 39, in main
    psd2svg(args.input, args.output, resource_path=args.resource_path)
  File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/__init__.py", line 20, in psd2svg
    return converter.convert(input, output)
  File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/__init__.py", line 59, in convert
    self.create_group(layer, self._dwg)
  File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/converter/core.py", line 71, in create_group
    element = self.convert_layer(layer)
  File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/converter/core.py", line 31, in convert_layer
    element = self.create_image(layer)
  File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/converter/core.py", line 85, in create_image
    self._get_image_href(layer.topil()),
  File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/converter/io.py", line 106, in _get_image_href
    image.save(output, format=fmt, icc_profile=icc_profile)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 2088, in save
    save_handler(self, fp, filename)
  File "/usr/lib/python2.7/dist-packages/PIL/PngImagePlugin.py", line 801, in _save
    raise IOError("cannot write mode %s as PNG" % mode)
IOError: cannot write mode CMYK as PNG
brunetton commented 4 years ago

Thank you @kyamagu ! Tested and approved 👍