View Issue Details

IDProjectCategoryView StatusLast Update
0016823ScribusGraphics / Image Framespublic2024-11-28 15:08
Reporterrafael.social.user@gmail.com Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version1.5.8 
Summary0016823: Scribus not showing correctly SVG
DescriptionI designed a SVG simple file, with stripped lines inside. LibreOffice (Writer and Draw) are not able to show the filled pattern.
Steps To Reproduce1.Insert "Rotulo.svg" in any new Impress or Draw document
Additional InformationScribus doesn't show SVG content as it should

Incorrectly displayed in Scribus and LibreOffice
Correctly displayed in any web browser and Inkscape (as you can see inmediately in "attached" file.

I notified it to LibreOffice bug tracker
https://bugs.documentfoundation.org/show_bug.cgi?id=149880
TagsNo tags attached.
PatchNo

Relationships

related to 0015838 closedjghali Images imported from Inkscape have errors 
child of 0002931 acknowledged Metabug: SVG 

Activities

rafael.social.user@gmail.com

2022-07-06 14:42

reporter  

Rotulo.svg (17,885 bytes)   
Rotulo.svg (17,885 bytes)   

JLuc

2022-07-09 12:43

developer   ~0049725

Issue is with `fill='url("#rough-1609495203056042")'` being ignored.
Imported shape is OK but content is empty

luzpaz

2023-12-22 16:04

reporter   ~0050686

Confirmed. The result of importing this SVG currently looks like:

```
Manjaro 23.1.0
Scribus Version 1.5.9.svn
Build ID: C--T-F-C1.15.10-64bit
Built: 13 August 2023
Companion Programs:
Ghostscript: 10.02.1
Libraries:
cairo: 1.15.10
Harfbuzz: 1.7.2
littlecms: 2090
podofo: 0.9.5
poppler: 0.62.0
```
Screenshot_20231222_110318.png (24,628 bytes)   
Screenshot_20231222_110318.png (24,628 bytes)   

nitramr

2023-12-26 19:09

developer   ~0050697

I checked the SVG plugin. Patterns are parsed in void SVGPlug::parsePattern(const QDomElement &b)

Scribus renders all patterns as an image. Especially for the "GIMP" example, the rendered pattern image is 1x1 px, because the pattern width and height is 1 px too. What is missing is the processing of the viewBox attribute.
See here: https://www.w3.org/TR/SVG11/pservers.html#Patterns

If I hard code the pattern size in the SVG plugin I get the result below. The pattern is correct, but it is blurry and the clipping is messed.

rafael.social.user@gmail.com

2023-12-27 11:40

reporter   ~0050698

I must add that LibreOffice fixed issue, maybe their patch could take into account to fix in Scribus this issue.

Thank you

JLuc

2023-12-27 12:30

developer   ~0050699

Hello Rafael, in case that might help, could you provide the url for the LibreOffice commit ?

nitramr

2023-12-27 13:44

developer   ~0050700

I imported the GIMP SVG file in Inkscape and LibreOffice Writer to check how it looks like. Both applications are importing the pattern as vector path. Scribus renders it as image. I think to make a correct fix, we should rethink the rendering / display of the pattern in Scribus. The SVG plugin creates the pattern correctly as PageItem_Polyline, but then it renders it as image to "unify" it for a later usage. Perhaps we should store the vector path information in a ScPattern object and render it at runtime correctly on canvas. In that way, the output renderer can decide how to render the pattern (as image, as vector graphic, as whatever).

It seems like it is a bigger research to check how LibreOffice implemented the import. I just found the SVG pattern parser, but it only reads the data in SVG file. BTW the parser handles all attributes defined by WC3, Scribus missed some.
https://github.com/LibreOffice/core/blob/master/svgio/source/svgreader/svgpatternnode.cxx

Object creation for canvas is somewhere else. I guess LibreOffice implementation doesn't really help us here, because Scribus has a good implementation. It only needs fixes for size calculation of the pattern and perhaps a better way how to import patterns. The clipping issue is not related to patterns, because it doesn't work for solid colors too (at least for the GIMP SVG file).

rafael.social.user@gmail.com

2023-12-27 16:12

reporter   ~0050702

Hi Jluc

I put the LibreOffice bug link to the thread I opened in "Additional information". Simply click that link and you will see how they fixed issue.

nitramr, I'm totally agree with you. Scribus should not convert SVG to bitmap. In fact, I always thought Scribus respect SVG content to let user to rescale and reuse vectorial objects.

JLuc

2024-11-28 10:57

developer   ~0051678

it looks like the issue for libreoffice was because of the doublequotes in the fill value.
AMOF it doesnt make any difference for scribus... but here is the SVG without doublequotes in fill value.
Rotulo_nodoublequotes.svg (17,883 bytes)   
Rotulo_nodoublequotes.svg (17,883 bytes)   

luzpaz

2024-11-28 15:00

reporter   ~0051683

> it looks like the issue for libreoffice was because of the doublequotes in the fill value.

is this then an upstream Libreoffice issue that should accommodate the doublequote edgecase ?

JLuc

2024-11-28 15:08

developer   ~0051685

Nope luzpaz. LibreOffice had an issue with doublequotes and fixed it. Scribus has a more complex issue as described by nitramr and raphael, and i i can't sum it up.

Issue History

Date Modified Username Field Change
2022-07-06 14:42 rafael.social.user@gmail.com New Issue
2022-07-06 14:42 rafael.social.user@gmail.com File Added: Rotulo.svg
2022-07-09 12:43 JLuc Note Added: 0049725
2023-12-22 16:04 luzpaz Note Added: 0050686
2023-12-22 16:04 luzpaz File Added: Screenshot_20231222_110318.png
2023-12-22 16:20 JLuc Relationship added child of 0002931
2023-12-26 19:09 nitramr Note Added: 0050697
2023-12-26 19:09 nitramr File Added: Bildschirmfoto vom 2023-12-26 20-03-54.png
2023-12-27 11:40 rafael.social.user@gmail.com Note Added: 0050698
2023-12-27 12:30 JLuc Note Added: 0050699
2023-12-27 13:44 nitramr Note Added: 0050700
2023-12-27 16:12 rafael.social.user@gmail.com Note Added: 0050702
2024-11-26 20:19 nitramr Relationship added related to 0015838
2024-11-28 10:57 JLuc Note Added: 0051678
2024-11-28 10:57 JLuc File Added: Rotulo_nodoublequotes.svg
2024-11-28 15:00 luzpaz Note Added: 0051683
2024-11-28 15:08 JLuc Note Added: 0051685