diff --git a/pkg/drawio/options.go b/pkg/drawio/options.go index c9d621e..16ba1ca 100644 --- a/pkg/drawio/options.go +++ b/pkg/drawio/options.go @@ -106,7 +106,7 @@ type ReadDirFunc func(string) ([]os.DirEntry, error) // Путь к приложению drawio func (opts Options) App() string { if opts.EnableXvfb { - return "xvfb" + return "xvfb-run" } app := opts.Application if len(app) == 0 { diff --git a/pkg/drawio/options_internal_test.go b/pkg/drawio/options_internal_test.go index c376f07..56e3a3d 100644 --- a/pkg/drawio/options_internal_test.go +++ b/pkg/drawio/options_internal_test.go @@ -64,6 +64,46 @@ func TestOptions(t *testing.T) { "--enable-plugins", }, }, + { + name: "png with xvfb", + opts: []Option{ + WithAppPath("/usr/local/bin/drawio"), + WithXvfb(), + WithOutput("/tmp/images/"), + WithFormat(PNG), + WithRecursive(), + WithRemovePageSuffix(), + WithQuality(100), + WithTransparent(), + WithEmbedDiagram(), + WithEmbedSvgImages(), + WithBorder(1), + WithScale(120), + WithWidth(800), + WithHeight(600), + WithCrop(), + WithUncompressed(), + WithEnablePlugins(), + }, + app: "xvfb-run", + outdir: "/tmp/images/", + outext: ".png", + args: []string{ + "-a", "-l", "/usr/local/bin/drawio", + "--format", "png", + "--quality", "100", + "--transparent", + "--embed-diagram", + "--embed-svg-images", + "--border", "1", + "--scale", "120", + "--width", "800", + "--height", "600", + "--crop", + "--uncompressed", + "--enable-plugins", + }, + }, } for _, test := range testData { t.Run(test.name, func(t *testing.T) {