piqnt / svgexport

SVG to PNG/JPEG command-line tool and Node.js module
927 stars 85 forks source link

TypeError: undefined is not a function (evaluating 'el.getBBox()') #33

Closed sasasimic closed 8 years ago

sasasimic commented 8 years ago

Hello, i have the problem with svgexport when i try to do export .svg to .png exp. svgexport 146945076057960a08a9ffb.svg test12.png i got error: TypeError: undefined is not a function (evaluating 'el.getBBox()')

undefined:24 :33 TypeError: null is not an object (evaluating 'input.height')

i have svgexport 3.10.3, node v6.3.0 and phantomjs 2.1.1 do You known what is the problem ? Thank you

shakiba commented 8 years ago

Can you please share your SVG file?

sasasimic commented 8 years ago

here are svg content

shakiba commented 8 years ago

This not a valid svg!

sasasimic commented 8 years ago

Ok here are whole file, i got file from svgtex api. 146945076057960a08a9ffb.txt

shakiba commented 8 years ago

That's also invalid. Change file name extension to svg (that is 146945076057960a08a9ffb.svg) and try to open it in a browser or svg viewer.

Tsenzuk commented 7 years ago

For future googlers: to prevent the issue with 'getBBox is not a function' check that you have a xmlns attribute in your xml tag. In other case phantomjs doesn't interpret the file as svg, but just as html/xml

isuldor commented 3 years ago

I ran into this error with the Grafana logo which appears to already have an xmlns attribute: https://grafana.com/static/img/logos/grafana_logo_swirl-events.svg