hello:
the subject is a primer, but an example and context can be found in this tiny repo: https://github.com/cdaringe/image-magick-svg-kaboom
thanks!
convert fills disk on simple svg to png conversion
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert fills disk on simple svg to png conversion
I am not an SVG expert, but try each of these to call different SVG renderers separately and see if any work. When you have multiple renderers, I do not know which it defaults to. Have you tried Inkscape?
Code: Select all
convert -background none MSVG:logo-clean.svg -resize 64x64 ico64.png
Code: Select all
convert -background none RSVG:logo-clean.svg -resize 64x64 ico64.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: convert fills disk on simple svg to png conversion
Your SVG contains
This is 35 giga pixels, for which Q16 would need 286 GB of memory.width="225756.934" height="158520.242"
snibgo's IM pages: im.snibgo.com
Re: convert fills disk on simple svg to png conversion
See https://www.imagemagick.org/script/security-policy.php. You can specify a maximum width or height and ImageMagick will report an exception if either limit is exceeded. However, the problem may not even be with ImageMagick-- but instead inkscape. ImageMagick has multiple SVG renderers. The default is inkscape. If that is the renderer you are using, the bug report may need to be pushed to their developers. To verify, type
If it reports inkscape, its inkscape that is likely filling your disk space. It might complete and return to ImageMagick where the security policy will deny further progress.
If we force an alternative renderer, MSVG, we get expected results with a proper security policy:
If we use the final SVG renderer, the RSVG delegate library, it also fails gracefully:
Code: Select all
convert -verbose logo.svg null:
If we force an alternative renderer, MSVG, we get expected results with a proper security policy:
Code: Select all
-> convert msvg:logo.svg null:
convert: width or height exceeds limit' @ error/cache.c/OpenPixelCache/3440.
convert: no images defined `null:' @ error/convert.c/ConvertImageCommand/3254.
Code: Select all
> convert logo.svg null:
convert: memory allocation failed `logo.svg' @ error/svg.c/ReadSVGImage/3076.
convert: no images defined `null:' @ error/convert.c/ConvertImageCommand/3254.
Re: convert fills disk on simple svg to png conversion
cool. thanks for the tips, all!
sure enough, inkscape. even this command completely locked up. `pkill -9 -f convert` wouldn't take it down.
Code: Select all
$ convert -verbose logo-clean.svg null:
'inkscape' '/var/folders/fr/wzg7ht8x7_x7dcjz036g1wlc0000gp/T/magick-99768D_F4TaJK4LvT' --export-png='/var/folders/fr/wzg7ht8x7_x7dcjz036g1wlc0000gp/T/magick-997681i-om65MXNWG' --export-dpi='90,90' --export-background='rgb(100%,100%,100%)' --export-background-opacity='1' > '/var/folders/fr/wzg7ht8x7_x7dcjz036g1wlc0000gp/T/magick-99768YwZZ8ALs5J3h' 2>&1