Save function not working

Issue #74 resolved
Former user created an issue

The save function doesn't work for jpg/png file types (svg does work). The resulting file types are corrupted.

To duplicate try the following for png or jpgs:

import schemdraw
from schemdraw import flow

with schemdraw.Drawing() as d:
    d += flow.Start().label('START')
    d += flow.Arrow().down(d.unit/3)
    d.save('test.png')

Comments (2)

  1. cdelker repo owner

    I think the SVG backend is not checking the file extension, and just putting SVG data into whatever file it gets. It should raise an exception on unsupported file types, but it could be nice to check if cairosvg is installed and use that to convert. Documentation needs fixing too.

    Note it works correctly when using Matplotlib as the backend.

  2. Log in to comment