Home > database >  Cannot save some SVG to JPG by pyvips
Cannot save some SVG to JPG by pyvips

Time:09-02

I met an issue when I convert this SVG to image and I cannot workaround, does anyone know the possible reason?

Error:

thread '<unnamed>' panicked at 'Cairo error "out of memory"', /build/librsvg-RSSQuy/librsvg-2.48.9/vendor/cairo-rs/src/enums.rs:274:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5

SVG URL: enter image description here

A very tall, thin image, with your map as the tiny square at the bottom. If you zoom and crop, you can get some detail:

$ /usr/bin/time -f %M:%e vips crop Carreteras_de_Pamplona.svg[scale=90] x.png 0 29972 1010 836
91368:0.57

90MB and 0.6s to make:

enter image description here

You can't zoom it any further, unfortunately, because librsvg won't render an image with any axis over 32k pixels.

If possible, I would go back to the SVG source and regenerate the file.

  • Related