piqnt / svgexport

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

Rendering SVG with images fails if scaling too high (image gone) #20

Closed RedRoosterMobile closed 9 years ago

RedRoosterMobile commented 9 years ago

Hi,

I have the following svg:

https://www.wetransfer.com/downloads/430cac04e6675d4bcd9ae85e4ac8b4e720150827150308/d18c71

it contains a relatively big base64-encoded image

I call the svgexport like that:

this works: svgexport city.svg city.png 2.36x

city

this (and higher scale) does not work: svgexport city.svg city.png 2.37x

city2 37

in the last call the image is gone, but everything else renders perfectly.

This upper limit varies depending on the image included. The bigger the image the earlier the upper limit is hit.

Any hints on how to debug this, or where to look, where to increase memory limits?

shakiba commented 9 years ago

I really have no idea. I think this is too much load for this tiny library! You may want to try other libraries such as imagemagic's convert command.

RedRoosterMobile commented 9 years ago

I figured out a way:

just link the image from harddisk, than it works up to 16x!

file:///Users/mojomacssd/rails/marcel/covergenerator/svgs/SW_DominikMartin.jpg

RedRoosterMobile commented 9 years ago

found a way to circumvent this. instead of base64ing the images, just save 'em and use file:// protocol

shakiba commented 9 years ago

I'm glad to hear that! :)

RedRoosterMobile commented 9 years ago

btw, I tried probably all other libraries and they are all shit (batik,imagick,rsvg, cairo, ..). Yours is, by far, the best! Thank you for that!

shakiba commented 9 years ago

Thanks, and thanks for sharing the issue and solution!