-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should we replace inkscape with rsvg-convert? #654
Comments
Using rsvg instead of Inkscape will bring rather predictable conversion issues, especially (but not limited to) when graphics have been originally created with Inkscape, e.g. when they use the flowRoot text element. You are right that Inkscape is huge and drags in a lot more dependencies than we want though. |
We've discussed this topic during our sync call. Probably we will have issues with the I've tried to create a test but was unable to find a
which seem to explain why it doesn't appear anymore. I can also save my SVG in Inkscape as version 1.1, not as 1.2. I'm pretty sure this flowRoot was available in the pre 1.0 version. I've also looked into our However, we may still have other conversion issues when using Maybe we need to compare if there are any differences between the Inkscape generated PNGs and the |
I've investigated a little bit further and wrote a small (dirty) Shell script that you can run on any cloned repo. It a) converts each SVG to PNG with rsvg-convert and inkscape and b) compares the result of the two PNGs with Shell script to convert and compare SVGs#!/bin/bash
BASEDIR=/tmp/svgcompare
LIBRSVG=$BASEDIR/librsvg
INKSCAPE=$BASEDIR/inkscape
DIFFS=$BASEDIR/diffs
mkdir -p $LIBRSVG $INKSCAPE $DIFFS
for i in images/src/svg/*.svg; do
base=${i##*/}
base=${base%%.svg}
format=png
echo "## Converting $i..."
rsvg-convert --format=$format --width=800 --height=600 \
--background-color=white $i > $LIBRSVG/$base.$format
inkscape --export-type=$format \
--export-width=800 --export-height=600 \
--export-background=white \
-o $INKSCAPE/$base.$format \
$i
echo "## Calculating difference for $i..."
# from https://askubuntu.com/a/209548 using Imagemagick
compare -compose src $INKSCAPE/$base.$format \
$LIBRSVG/$base.$format \
$DIFFS/$base.$format
done My findings so far:
|
Aah, good to know! I never knew this tool existed! In the past, Inkscape created flowRoots when dragging open a bounding box first rather than just clicking and then typing. However, I just tried it on Inkscape 1.0.1 (the version that ships in Leap 15.3) and, you're right, it does not create flowRoots in either case! Progress! Awesome. |
After some further tests, the If we really want to move away from Inkscape, it could be an alternative. However, it's Java, so it's not as fast as Inkscape or |
However, we probably already need the Batik rasterizer because we use FOP. So, speed and java-ness aside, if Batik is a good implementation of SVG and runs reliably, then using that as broadly as possible sounds like a good idea. (edit We have our troubles with FOP... and switching away from FOP has been on my mind more than once. That might play into this decision too.) I just checked how the Dia pipeline works and it seems that is already independent from Inkscape -- DAPS currently allows DIA->PNG and DIA->SVG but both only use the DIA->PNG -- make/images.mk:448:
Analogously on l. 520 for DIA->SVG. |
I will work on this one. This is the only reason why SLFO:Main:Build has curently inkscape. And it's ridiculous that SLES with almost no desktop has inkscape in it. Once the dependency from daps is gone, we can keep inkscape simply in Leap and offer it to sles via PACKAGEHUB. Thx |
Problem description
Some time ago we had some issues with Inkscape:
It seems we could replaces Inkscape with a more light-weight tool.
Idea
I got informed that Fedora had some problems with Inkscape too (see [1]). This was mainly for the dblatex tool, but it should be correct for daps as well. Originally, the bug was filed in [2], but it seems the Inkscape won't fix it. Fedora created a patch[3] because of this which basically replaces
inkscape
withrsvg-convert
.We need to check if:
References
The text was updated successfully, but these errors were encountered: