Skip to content

Ghostscript Requirement #378

Description

@jameson0496

When opening a document with PDF images (specifically a typst document, not tested on other file formats), I get an error about the command 'gs' not being found:

...nvim/lazy/image.nvim/lua/image/processors/magick_cli.lua:115: sh: line 1: gs: command not found                                                                                                                                            
identify: FailedToExecuteCommand `'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=png16malpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r72x72' -dPrinted=f
alse  '-sOutputFile=/tmp/nix-shell-111807-2176585950/magick-7u_VuIfAffICPKYYbLSGSN1hcq7PFuRa%d' '-f/tmp/nix-shell-111807-2176585950/magick-_nLrES0JB748eAdUmDaNkMl_SyYHlUzy' '-f/tmp/nix-shell-111807-2176585950/magick-I_W98t-7tVzXcF7Kcx5g8Z5
sBs5VnTNG'' (32512) @ error/ghostscript-private.h/ExecuteGhostscriptCommand/75.                                                                                                                                                               
                                                                                                                                                                                                                                              
stack traceback:                                                                                                                                                                                                                              
        [C]: in function 'error'                                                                                                                                                                                                              
        ...nvim/lazy/image.nvim/lua/image/processors/magick_cli.lua:115: in function <...nvim/lazy/image.nvim/lua/image/processors/magick_cli.lua:114>                                                                                        
        [C]: in function 'wait'                                                                                                                                                                                                               
        ...nvim/lazy/image.nvim/lua/image/processors/magick_cli.lua:130: in function 'get_dimensions'                                                                                                                                         
        ...jw/.local/share/nvim/lazy/image.nvim/lua/image/image.lua:329: in function <...jw/.local/share/nvim/lazy/image.nvim/lua/image/image.lua:251>                                                                                        
        [C]: in function 'pcall'                                                                                                                                                                                                              
        .../share/nvim/lazy/image.nvim/lua/image/utils/document.lua:238: in function 'process_image_queue'                                                                                                                                    
        .../share/nvim/lazy/image.nvim/lua/image/utils/document.lua:309: in function 'render'                                                                                                                                                 
        .../share/nvim/lazy/image.nvim/lua/image/utils/document.lua:314: in function 'callback'                                                                                                                                               
        ...vim/lazy/image.nvim/lua/image/utils/render_scheduler.lua:18: in function <...vim/lazy/image.nvim/lua/image/utils/render_scheduler.lua:13>                                                                                          

After a quick search online, I installed Ghostscript and the error went away. Does image.nvim make any calls to Ghostscript or is this command generated by ImageMagick? I looked through the code and didn't notice any calls, but I'm also not super fluent in Lua. Either way, a note in the README on Ghostscript being a requirement for PDF images could be helpful, given that Magick does not explicitly require it for installation (The recommended NixOS package does not install it as a dependency).

NixOS (Unstable), Neovim v0.12.3, Ueberzug backend, magick_cli processor. This plugin works great, not having images in my notes was my last holdout for moving to Neovim from my GUI notes app.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions