lehitoskin / ivy

Ivy, the Taggable Image Viewer
GNU General Public License v3.0
16 stars 3 forks source link

Odd SVG behavior #49

Open lehitoskin opened 8 years ago

lehitoskin commented 8 years ago

Weird things happen when trying to render the SVG from Awesome Inc (see #47). It's actually a problem with librsvg and not with Ivy, but I am creating this issue for future reference in case something like this happens again. 99.9% of SVG's I've tested (and have on my own computer) work just fine, but perhaps we'll see another aberration like this again.

IonoclastBrigham commented 8 years ago

Possibly the same upstream bug:

https://bugs.launchpad.net/ubuntu/+source/librsvg/+bug/575984

Includes a test file, which on my mac with the latest from master renders as completely blank in ivy.

IonoclastBrigham commented 7 years ago

For further context, this appears to be related specifically to rendering certain kinds of text definitions. Anything without text should probably display just fine.

IonoclastBrigham commented 6 years ago

Here's the ultimate rsvg bug ticket:

https://gitlab.gnome.org/GNOME/librsvg/issues/13

It's over a decade old, unassigned, and doesn't seem to have any movement. If we're not willing to try to fix it ourselves (possibly a bottomless rabbithole), the only way to really fix this is probably to replace it with another library, like imagemagick or something.

lehitoskin commented 6 years ago

That is a good idea. imagemagick, specifically, however, depends on librsvg. graphicsmagick depends on libxml2. It's not impossible that I could find a way to use libxml2 directly, instead of relying on graphicsmagick, which is pretty hefty.

IonoclastBrigham commented 6 years ago

I'd suggest not going down that road. Loading SVGs is a lot more than just parsing the XML. You also have to render the shapes, apply groupings, layers, and effects, possibly handle animations (you have to at least be aware of such things to you don't blow up when you inevitably try to load one)...

I tried doing this on Android back in the 4.x days and it quickly became a bigger project than the one I was trying to use it in. If graphicsmagick seems way overkill, there's gotta be something lighter we could use.

Doesn't look to be much natively in Racket, but there's a bunch of C++ libraries. One of those might work with a very simple FFI wrapper.