Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd SVG behavior #49

Open
lehitoskin opened this issue Oct 15, 2016 · 5 comments
Open

Odd SVG behavior #49

lehitoskin opened this issue Oct 15, 2016 · 5 comments
Labels

Comments

@lehitoskin
Copy link
Owner

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Owner Author

lehitoskin commented May 3, 2018

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
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants