Inkscape.org
Beginners' Questions Disable Warnings
  1. #1
    kcrouse kcrouse @kcrouse

    When running from the command line, is there a way to disable the warnings inkscape outputs? Thanks!

  2. #2
    inklinea inklinea @inklinea⛰️

    Linux : 

     inkscape --batch-process --actions="export-filename:test.png;export-do;" drawing.svg &>/dev/null
     

    Windows ( possibly :) )

    inkscape --batch-process --actions="export-filename:test.png;export-do;" drawing.svg 2> nul

  3. #3
    kcrouse kcrouse @kcrouse

    Linux works with "inkscape ... 2> /dev/null" unless the command line is executed from an execl call. I was hoping there was a "--quiet" switch. Oh well, thanks! Future snowflake add-on? I appreciate the rapid answer! BTW, this is a fantastic tool!

  4. #4
    inklinea inklinea @inklinea⛰️

    There are a couple of other ways to feed commands into Inkscape via the command line.

    If you have a file - or can send text 

    inkscape --shell < commands.txt drawing.svg &>/dev/null

    where commands.txt contains lines like 

    echo 'file-open:drawing.svg;export-dpi:300;export-type:png;export-do' | inkscape --shell  &>/dev/null

    or 

    echo 'file-open:drawing.svg;export-dpi:300;export-type:png;export-do' | inkscape --shell 

    But that does not work with verbs which require a gui.

    exec echo 'file-open:drawing.svg;export-dpi:300;export-type:png;export-do' | inkscape --shell  &>/dev/null

    works - unless you mean a call from within a c++ program, which have no knowledge of.

    There is also the --pipe option.

    https://wiki.inkscape.org/wiki/index.php/Using_the_Command_Line

    exec cat testing.svg | inkscape --pipe --actions="export-filename:testing.png;export-do;" &>null

    which does work for me. 

     

     

  5. #5
    kcrouse kcrouse @kcrouse

    Please don't misunderstand. Inkscape is executing the conversion I want flawlessly! The only issue at all is that I get about 200 warnings in the process which I'd like to throw away. They are on stderr. As the command is run from an "execl" call, "2> /dev/null" won't work, I have to manipulate pipes. An option for either "quiet" or "nowarnings" would solve the issue easily but would require an inkscape modification. Thank you for all of the suggestions as they are all very workable and wonderful alternatives which I shall keep in mind for later.