https://bugs.kde.org/show_bug.cgi?id=522468

--- Comment #3 from Joshua Kinard <[email protected]> ---
(In reply to wolthera from comment #2)
> Can confirm, but not sure what we can do about it: The fix here is to add:
> width="5080pt" height="5080pt"
> The problem isn't the SVG file by itself, but rather that it insists telling
> us it's viewport is 50800x50800, so krita loads it as a 50800x50800px file.

So I now think this points out that the core issue is with how LibreOffice
Impress is exporting SVGs.  I was noticing problems in other vector editing
programs with SVGs exported by Impress.  Most notably with Inkscape, where if I
opened the bugged SVG I attached here, clicked the group object in it, went to
the export panel and exported just the selected object, Inkscape was writing
out an SVG with dimensions of 2064562816 x 1032306816 (in pixels), which caused
issues with every other program that tried to open that exported SVG.  In that
instance, Inkscape seemed to be taking the viewport dimensions of 50800 and
multiplying them by the object's dimensions.  By following your suggestions to
add 'width="5080pt" height="5080pt"' to the <svg> tag in the file, that just
solved not only Krita's issue, but also Inkscape's, and it now exports the
selected object with correct dimensions.

There's another, long-open bug with LibreOffice Impress adding
'visibility="hidden"' to <g> tags that messes up displaying widgets (LO
PR#143082), so manually fixing that, plus this edit, in an exported SVG now
lets me work with the SVG in other programs.

I agree with you that I'm not sure what Krita can really do here.  An
uneducated idea is maybe to have it check if width & height are provided, and
if not, see if the viewport dimensions exceed a reasonable value, and if so,
divide them by 10, add "pt" to the end, and try to load it.  Maybe even have it
only do this if it detects OpenOffice namespaces in the SVG metadata, so it can
flag that this is an SVG exported by LibreOffice and may not display correctly.

I'll check LibreOffice's bug tracker and see if there's already a bug about it
not include width & height fields in the <svg> tag, and if I find one, comment
about the knock-on effects this is having in Krita and Inkscape.  If not, I'll
open a new one for them to fix sometime in the next 10-15 years (which seems to
be their usual timeframe...).

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to