ConvertX
ConvertX copied to clipboard
fix(docker): add python3-tinycss2 for Inkscape DXF export
Description
Adds the missing python3-tinycss2 Python package to the Docker images to fix PNG → DXF conversion using Inkscape.
Problem
Inkscape's DXF export extension (dxf12_outlines.py) requires the tinycss2 module which was not installed in the container, causing PNG → DXF conversions to fail with:
** (inkscape:80): WARNING **: 13:51:34.782: Failed to wrap object of type 'GtkRecentManager'. Hint: this error is commonly caused by failing to call a library init() function.
Script Error
----
Traceback (most recent call last):
File "/usr/share/inkscape/extensions/dxf12_outlines.py", line 29, in <module>
import inkex
File "/usr/share/inkscape/extensions/inkex/__init__.py", line 11, in <module>
from .extensions import *
File "/usr/share/inkscape/extensions/inkex/extensions.py", line 34, in <module>
from .elements import (
...<10 lines>...
)
File "/usr/share/inkscape/extensions/inkex/elements/__init__.py", line 10, in <module>
from ._base import ShapeElement, BaseElement
File "/usr/share/inkscape/extensions/inkex/elements/_base.py", line 40, in <module>
from ..styles import Style, Classes, StyleValue
File "/usr/share/inkscape/extensions/inkex/styles.py", line 31, in <module>
import tinycss2
ModuleNotFoundError: No module named 'tinycss2'
The error occurs because:
- Inkscape uses Python extensions for certain export formats
- The
dxf12_outlines.pyscript importsinkex -
inkexdepends ontinycss2for CSS parsing in SVG styles
Solution
- ✅ Added
python3-tinycss2to mainDockerfile - ✅ Added
python3-tinycss2to.devcontainer/Dockerfilefor consistency - ✅ Tested locally with Docker - PNG → DXF conversion now works
Testing Steps
- Built Docker image locally
- Ran container with test PDF file
- Converted PDF → DXF using Inkscape converter
- Verified DXF file was generated successfully without tinycss2 error
Related Issue
Fixes #494
Summary by cubic
Added python3-tinycss2 to Docker images to fix Inkscape’s DXF export, restoring PNG → DXF conversion in the container.
-
Dependencies
- Added python3-tinycss2 to Dockerfile and .devcontainer/Dockerfile.
Written for commit 12e5ec3a5ca8ebc16b73b5a33b18fb83853e272e. Summary will update on new commits.