Bug 165900 - Incorrect position of the transparency gradient applied to the object after SVG export
Summary: Incorrect position of the transparency gradient applied to the object after S...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
25.2.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-25 11:58 UTC by Maks Lysohorov
Modified: 2025-04-21 13:17 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Pptx presentation with issue (36.68 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2025-03-25 11:58 UTC, Maks Lysohorov
Details
Exported SVG sample (487.23 KB, image/svg+xml)
2025-03-25 12:06 UTC, Maks Lysohorov
Details
Screenshot of the issue (72.91 KB, image/png)
2025-04-21 09:48 UTC, Maks Lysohorov
Details
Manually set three transparency gradient stops (14.84 KB, application/vnd.oasis.opendocument.graphics)
2025-04-21 13:16 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maks Lysohorov 2025-03-25 11:58:32 UTC
Created attachment 200011 [details]
Pptx presentation with issue

Incorrect applying of gradient to the object after export to SVG

Expected result: correct apply of gradient afte export to SVG
Comment 1 Maks Lysohorov 2025-03-25 12:06:49 UTC
Created attachment 200015 [details]
Exported SVG sample
Comment 2 Regina Henschel 2025-04-14 21:30:58 UTC
I cannot confirm it. The linear gradient is correctly exported to SVG. Perhaps you use colors red, yellow and blue for the color stops so that they are better to distinguish than variants of gray. And then describe again, why do you think, that the gradient has a wrong position.

I have tested it with Version: 25.2.1.2 (X86_64) / LibreOffice Community
Build ID: d3abf4aee5fd705e4a92bba33a32f40bc4e56f49
CPU threads: 32; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded
Comment 3 Maks Lysohorov 2025-04-21 09:48:18 UTC
Created attachment 200433 [details]
Screenshot of the issue

Thanks for the clarification!
I've attached a screenshot of how it looks in LibreOffice v.25.2.2 and how it looks in the exported SVG
Comment 4 Regina Henschel 2025-04-21 11:32:34 UTC
The alpha mask has wrong value rgb(0,0,0) instead of rgb(255,255,255) at position 0.5.
Comment 5 Regina Henschel 2025-04-21 13:16:24 UTC
Created attachment 200441 [details]
Manually set three transparency gradient stops

The problem exists for a native ODF file as well. Only LO has no UI to set multiple transparency gradient stops. The attached file has set such gradient stops manually in file markup.

It seems, that in generating the <mask> element for SVG there is done some "reversing", but in a wrong way.
The odg-file has
<draw:opacity draw:name="MyTransparency"
              draw:style="linear"
              draw:start="100%"
              draw:end="0%"
              draw:angle="0deg">
      <loext:opacity-stop svg:offset="0" svg:stop-opacity="1" />
      <loext:opacity-stop svg:offset="0.3" svg:stop-opacity="0.9" />
      <loext:opacity-stop svg:offset="1" svg:stop-opacity="0.2" />
</draw:opacity>

That becomes in SVG
<linearGradient id="gradient1"
                x1="11000" y1="2000"
                x2="11000" y2="26000"
                gradientUnits="userSpaceOnUse">
       <stop offset="0" style="stop-color:rgb(204,204,204)"/>
       <stop offset="0.7" style="stop-color:rgb(25,25,25)"/>
       <stop offset="1" style="stop-color:rgb(0,0,0)"/>
</linearGradient>

The problem becomes visible for the pptx file attached by the reporter, because the pptx import creates three stops in the transparency gradient from the three color stops on the pptx file.