Environment
- image.nvim:
44e0712 (latest master)
- Neovim:
v0.12.2
- ImageMagick:
7.1.2-25 CLI (magick_cli processor)
- librsvg / rsvg-convert:
2.62.3 (installed, configured as ImageMagick SVG delegate)
- OS: macOS (Apple Silicon, Darwin 25.5.0)
What happens
Opening any markdown file with remote badge images (shields.io, badgen.net, travis-ci) triggers repeated error notifications:
Lua callback:
...image.nvim/lua/image/processors/magick_cli.lua:115: identify: unable to open image
'image/svg+xml;base64,PHN2Gy...': No such file or directory @ error/blob.c/OpenBlob/3690
Root cause
The error is not from image.nvim passing a data URI as a path. The chain is:
- Remote badge URL (e.g.
badgen.net) is downloaded → temp SVG file
is_image() correctly recognises SVG → get_dimensions(tmp_path) is called
magick identify <tmp_path> runs on the SVG file
- The badge SVG contains embedded icons as
<image href="data:image/svg+xml;base64,..."/> elements
- ImageMagick's internal SVG renderer tries to open
image/svg+xml;base64,... as a file path (strips data:, treats the MIME type as a relative path) → fails with non-zero exit
error() fires inside the vim.loop.spawn callback at magick_cli.lua:115 → escapes the surrounding pcall in document.lua → notification shown to user
Reproducible without Neovim:
curl -s "https://badgen.net/badge/Bitcoin/Donate/F19537?icon=bitcoin" -o /tmp/badge.svg
magick identify /tmp/badge.svg
# → identify: unable to open image 'image/svg+xml;base64,...': No such file or directory
Two separate issues
- ImageMagick SVG bug -
identify doesn't handle data: URIs in SVG <image> elements. Using rsvg-convert (the configured SVG delegate) for SVG dimension extraction would avoid this, as rsvg-convert handles embedded data URIs correctly. Alternatively, parse viewBox/width/height directly from the SVG XML.
- image.nvim error handling -
error() inside vim.loop.spawn async callback escapes pcall. The non-zero exit from identify should be caught per-file without propagating as a user-visible notification.
Report generated by Claude, but issue is real (
Environment
44e0712(latest master)v0.12.27.1.2-25CLI (magick_cliprocessor)2.62.3(installed, configured as ImageMagick SVG delegate)What happens
Opening any markdown file with remote badge images (shields.io, badgen.net, travis-ci) triggers repeated error notifications:
Lua callback:
Root cause
The error is not from image.nvim passing a data URI as a path. The chain is:
badgen.net) is downloaded → temp SVG fileis_image()correctly recognises SVG →get_dimensions(tmp_path)is calledmagick identify <tmp_path>runs on the SVG file<image href="data:image/svg+xml;base64,..."/>elementsimage/svg+xml;base64,...as a file path (stripsdata:, treats the MIME type as a relative path) → fails with non-zero exiterror()fires inside thevim.loop.spawncallback atmagick_cli.lua:115→ escapes the surroundingpcallindocument.lua→ notification shown to userReproducible without Neovim:
curl -s "https://badgen.net/badge/Bitcoin/Donate/F19537?icon=bitcoin" -o /tmp/badge.svg# → identify: unable to open image 'image/svg+xml;base64,...': No such file or directoryTwo separate issues
identifydoesn't handledata:URIs in SVG<image>elements. Usingrsvg-convert(the configured SVG delegate) for SVG dimension extraction would avoid this, as rsvg-convert handles embedded data URIs correctly. Alternatively, parseviewBox/width/heightdirectly from the SVG XML.error()insidevim.loop.spawnasync callback escapespcall. The non-zero exit fromidentifyshould be caught per-file without propagating as a user-visible notification.Report generated by Claude, but issue is real (