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

Out of memory on transformed text #3

Open
valpackett opened this issue May 30, 2014 · 10 comments
Open

Out of memory on transformed text #3

valpackett opened this issue May 30, 2014 · 10 comments

Comments

@valpackett
Copy link

node-rsvg blows up with error: out of memory when text (or a group with text, etc.) is transformed.
rsvg-convert works just fine though!

Minimal test case:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="256" height="256">
  <text transform="translate(10, 10)" x="0" y="0" font-size="7.5">Hello</text>
</svg>
@valpackett valpackett changed the title Out of memory on translated text Out of memory on transformed text May 30, 2014
@waltfy
Copy link

waltfy commented Sep 4, 2014

@myfreeweb I think this is not just with the transform attribute, I get the error with a simple:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="256" height="256">
  <text x="10" y="10">Anything</text>
</svg>

Digging through the C++ see if I can find anything obvious.

Update

So, it seems that Cairo is returning out of memory on the following assignment:

cairo_status_t status = cairo_status(cr);

https://github.com/walling/node-rsvg/blob/master/src/Rsvg.cc#L396

@raphdg
Copy link

raphdg commented Oct 16, 2014

Same here.
@waltfy Have you been able to go through this?

@waltfy
Copy link

waltfy commented Oct 22, 2014

@raphdg No. Ended up giving up, as we had to move on. Would like to know where it ends up. Maybe I'll take a look at it over the weekend?

@gabegorelick
Copy link

Has anyone made any progress on this? This effectively means I have to call out to rsvg-convert instead of using node-rsvg.

So, it seems that Cairo is returning out of memory on the following assignment:

FYI, from reading the Cairo API it looks like that function just reports pre-existing errors. So the out of memory error is occurring sometime before that call to cairo_status.

@flahertyb
Copy link

A fix here would also be a huge help to me.

@azriel46d
Copy link

any updates on this?
I'm getting the following error on text values

Assertion failed: (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&cr->ref_count)), function cairo_destroy, file cairo.c, line 301.

The only text value which is being render is 0. Otherwise, any of the above mentioned examples return the above error

@valpackett
Copy link
Author

Looks like this is fixed in 2gis/node-rsvg which is, apparently, the official fork (it's listed as the website on npm).

@ankurp
Copy link

ankurp commented Oct 24, 2016

Does anyone have a fix for this. @myfreeweb the fork also does not fix this issue. I just tried it and run into the same issue.

@mitar
Copy link

mitar commented Nov 14, 2016

I also have a problem with this with the following SVG:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" pointer-events="none" width="50" height="50" style="width: 50px; height: 50px; background-color: #2196F3;">
  <text text-anchor="middle" y="50%" x="50%" dy="0.36em" pointer-events="auto" fill="#ffffff" font-family="Helvetica, Arial, Lucida Grande, sans-serif" style="font-weight: 400; font-size: 28px;">
    AD
  </text>
</svg>

@mitar
Copy link

mitar commented Nov 14, 2016

I reported it in 2gis repository: 2gis#7

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

No branches or pull requests

8 participants