fix: Inkscape GTK 錯誤 - 使用 xvfb-run 包裝

- 安裝 xvfb 到 Docker image
- 使用 xvfb-run -a 包裝 inkscape 命令
- 設定虛擬螢幕解析度 1024x768x24
- 修復 PNG 轉 SVG 等需要 GTK 的操作

Fixes: Gtk-ERROR Can't create GtkStyleContext without display
This commit is contained in:
Your Name 2026-01-23 11:57:26 +08:00
parent 9fc7217df1
commit 0d0c0025fb
2 changed files with 19 additions and 14 deletions

View file

@ -167,13 +167,14 @@ RUN apt-get update --fix-missing && apt-get install -y --no-install-recommends \
# 階段 4圖像處理工具
# 注意bookworm 使用 imagemagick版本 6trixie 才有 imagemagick-7
# 注意Inkscape 1.0+ 使用 --export-type/--export-filename 語法,支援 headless 執行,不需要 xvfb
# 注意Inkscape 需要 xvfb 在無 DISPLAY 環境下執行某些操作(如 PNG 轉 SVG
RUN apt-get update --fix-missing && apt-get install -y --no-install-recommends \
imagemagick \
inkscape \
libheif-examples \
libjxl-tools \
libvips-tools \
xvfb \
&& rm -rf /var/lib/apt/lists/*
# 階段 5文件處理工具