Bug 166283 - Do not export radial gradient as pattern fill to SVG but as radialGradient
Summary: Do not export radial gradient as pattern fill to SVG but as radialGradient
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-21 16:09 UTC by Regina Henschel
Modified: 2025-04-21 22:03 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Source for export to SVG (35.12 KB, application/vnd.oasis.opendocument.graphics)
2025-04-21 16:09 UTC, Regina Henschel
Details
Expected svg file (6.23 KB, image/svg+xml)
2025-04-21 16:11 UTC, Regina Henschel
Details
Screenshot how it is seen with Firefox. (683.01 KB, image/png)
2025-04-21 22:03 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2025-04-21 16:09:10 UTC
Created attachment 200448 [details]
Source for export to SVG

Open attached file and export the page to SVG. Open the generated svg-file in a browser and compare with the original.

Errors:
The exported fill is a <pattern>-Element instead of a <radialGradient> element.
The exported fill does not use all color steps.

The export uses for each shape is own fill definition. We could keep that, but use the <radialGradient> element with absolute values for cx, cy and r. The calculation would be: cx = shape pos x + offsetX * shape width, cy = shape pos y + offsetY * shape height, r = 0.5 * sqrt(shape width^2 + shape height^2). Of cause a gradient border would need to first be incorporated into the color stop positions and the color stop positions need to be reversed for SVG.
I'll attache a svg-file to show what can be archieved.
Comment 1 Regina Henschel 2025-04-21 16:11:40 UTC
Created attachment 200449 [details]
Expected svg file

<pattern> elements removed and replaced with <radialGradient> elements with absolute values.
Comment 2 m_a_riosv 2025-04-21 22:03:36 UTC
Created attachment 200451 [details]
Screenshot how it is seen with Firefox.

Reproducible
Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6869da60961a6213fc961c2ece371c0f18038cde
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-GB
Calc: CL threaded