SVG 1.0 nach SVG 1.1
Da EPUB 2.0 auf SVG 1.1 referenziert, sollten wir auch SVGs in der erwarteten Version erzeugen. Auf das Problem bin ich gestoßen, als ich für das »Bunte Bilder aus dem Sachſenlande« - Projekt mal den epubcheck aufgerufen hatten:
epubcheck bunte_bilder.epub
und ff. Meldungen bekam:
Validating against EPUB version 2.0 - custom validation
Validating using EPUB version 2.0 rules.
ERROR(RSC-005): bunte_bilder.epub/OEBPS/img/003_Wappen.svg(6,38): Error while parsing file 'value of attribute "version" is invalid; must be equal to "1.1"'.
Abhilfe schafft ff. Aufruf von inkscape:
inkscape -z -E=tmp.eps svg1.0.svg
inkscape -z -l=svg1.1.svg tmp.eps
Die Zweiteilung mit Umweg über EPS ist notwendig, weil inkscape SVGs dann nicht in neue Version konvertiert, wenn diese valide ist und alle Elemente in neuer Version gültig sind. Mit “-z” unterdrückt man die GUI und “-E” exportiert nach EPS, “-l” nach SVG.
Um alle Bilder im Verzeichnis zu konvertieren, nutzt man ff. Schleife in der Bash:
for i in *.svg; do
inkscape -z -E=tmp.eps $i;
inkscape -z -l=$i tmp.eps;
rm -f tmp.eps;
done
Wer noch andere Varianten/Tools kennt, melde sich bitte. :)