dlemstra / magick-wasm

The WASM library for ImageMagick
Apache License 2.0
563 stars 38 forks source link

Can't open SVG files (or any other vector graphics) #141

Open adyster opened 9 months ago

adyster commented 9 months ago

magick-wasm version

0.0.27

Description

I'm unable to open SVG files. Same problem with pretty much every other vector graphic format. Throws an error.

Steps to Reproduce

Can test it with the demo documents app.

Images

Screenshot 2024-01-21 at 8 14 09 pm
dlemstra commented 9 months ago

I did not add support for SVG files because browsers tend to be better at this. I would advise you to draw the svg on a canvas and then read the image from that canvas.

adyster commented 9 months ago

Oh, ok. It comes up as one of the supported file formats in supportedFormats.

Yes, that works for SVG files. I was actually mainly interested in the other vector graphics formats such as Adobe Illustrator (AI), which is listed as a supported format too. Those unfortunately aren't supported natively with the browser. :-/

dlemstra commented 9 months ago

That are listed as a format but that doesn't mean the format is supported. I should probably make this more clear by renaming the property or remove some formats. I think I will need to remove formats that support reading by using an external executable.

Other vector formats are not supported because they require an external executable. And I cannot package a wasm version of Ghostscript due to licensing issue. It might be possible but not something I will invest time on anytime soon.