Verbs and actions do not work in a headless system
Summary:
Inkscape provides functionality to edit SVGs from the command line as part of batch processing through verbs or actions. The usefulness of this functionality is severely impeded by the fact that many verbs, even "save file" are only available when a UI is present.
This completely breaks workflows in which automatic processing of SVGs, e.g., on a webserver, is required. There simply is no GUI present. There is no technical reason for a UI to be present in order to load or process SVG files, this is completely decoupled functionality.
Steps to reproduce:
$ unset DISPLAY
$ inkscape --batch-process --actions="FitCanvasToDrawing;FileSave" xyz.svg
No GUI available, some actions may fail
WARNING: ignoring verb FitCanvasToDrawing - GUI required for this verb.
** (inkscape:732348): CRITICAL **: 10:13:03.604: static void Inkscape::FitCanvasVerb::perform(SPAction*, void*): assertion 'ensure_desktop_valid(action)' failed
WARNING: ignoring verb FileSave - GUI required for this verb.
** (inkscape:732348): CRITICAL **: 10:13:03.604: static void Inkscape::FileVerb::perform(SPAction*, void*): assertion 'ensure_desktop_valid(action)' failed
$ inkscape --verb=FitCanvasToDrawing --verb=FileSave xyz.svg
WARNING: ignoring verb FileSave - GUI required for this verb.
** (inkscape:732468): CRITICAL **: 10:13:12.981: static void Inkscape::FileVerb::perform(SPAction*, void*): assertion 'ensure_desktop_valid(action)' failed
What happened?
Inkscape did nothing.
What should have happened?
It should have fit the canvas to drawing and saved the file.
Sample attachments:
Version info
Inkscape 1.1.2 (0a00cf5339, 2022-02-04)
GLib version: 2.74.0
GTK version: 3.24.34
glibmm version: 2.66.4
gtkmm version: 3.24.6
libxml2 version: 2.9.14
libxslt version: 1.1.35
Cairo version: 1.16.0
Pango version: 1.50.10
HarfBuzz version: 2.7.4
Poppler version: 22.08.0
OS version: Ubuntu 22.10