Bug 155549 - MCGR improve backward compatibility for axial gradients
Summary: MCGR improve backward compatibility for axial gradients
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha1+
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:7.6.0
Keywords:
Depends on:
Blocks: OOXML-Object-Fill
  Show dependency treegraph
 
Reported: 2023-05-29 17:00 UTC by Regina Henschel
Modified: 2023-06-05 15:43 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
shape with linear gradient as generated by export of an axial gradient (5.04 KB, application/zip)
2023-05-29 17:00 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2023-05-29 17:00:06 UTC
Created attachment 187590 [details]
shape with linear gradient as generated by export of an axial gradient

Open attached docx file in a current master build. Save it as odt file. Open the saved file in LO 7.5. The fill of the shape is not correct.
Do the same with LO 7.5 and the shape in the odt file shows a correct fill.

LibreOffice export to OOXML writes an axial color gradient as a linear gradient with symmetric color stops. Version 7.5 converts such symmetrical linear gradient to an axial gradient on import. With the changes from MCGR this no longer happens, because now LibreOffice can held a sequence of color stops in a linear gradient.
When now such gradient is saved to ODF, the color stops are written in new kind color stop elements. Versions before 7.6 do not understand these elements and ignore them. So they see only the first and last color in the sequence but not the intermediate colors.

To generate a gradient, that can be shown as before by versions before 7.6, it is needed to convert the symmetrical linear gradient to an axial gradient. This could be done on import of OOXML as before or on export to ODF.

Linear multi-color gradients are used not only by OOXML, but by binary MS-Office formats, RTF, VML, and by SVG, and they can be created by the user from scratch. Therefore it is preferable to use it internally too in LibreOffice in a long term. 

Thus my current idea is to add the conversion to 'axial' in the ODF export.
Comment 1 Regina Henschel 2023-06-01 17:34:44 UTC
I'll work on it.
Comment 2 Commit Notification 2023-06-05 15:35:03 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6c49886ab46c53398d74610b264e5edb0332a059

tdf#155549 MCGR: Recreate 'axial' from symmetric 'linear'

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.