Bug 94731 - Look of square/quadratic gradient changed
Summary: Look of square/quadratic gradient changed
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.1.6.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL: https://issues.oasis-open.org/browse/...
Whiteboard:
Keywords:
Depends on:
Blocks: ODF-import Object-Fill
  Show dependency treegraph
 
Reported: 2015-10-03 12:23 UTC by Yousuf Philips (jay) (retired)
Modified: 2023-03-19 23:23 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
sample file (10.03 KB, application/vnd.oasis.opendocument.text)
2015-10-03 12:23 UTC, Yousuf Philips (jay) (retired)
Details
master vs 3.3 (80.13 KB, image/png)
2015-10-03 20:28 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2015-10-03 12:23:55 UTC
Created attachment 119237 [details]
sample file

In LO 4.1, the gradient labelled 'Square' was renamed to 'Quadratic' and its look was altered to always show as a square even when the shape was a rectangle. This causes problems as other odf software (calligra, mso) show it in the old way, and ooxml files import with the incorrect looking square gradient.

Also the gradient labelled 'Rectangular' was also changed 'Square' at the same time and this doesnt correspond to how the gradient looks.

As this also is in AOO 4.1.1, i'm assuming it was merged from their code. The XML has them as <draw:gradient draw:style="square"> and <draw:gradient draw:style="rectangular">.

With the sample attachment, drag the bottom part of the square shapes to test the behaviour between 4.0 and master.

Version: 5.1.0.0.alpha1+
Build ID: ef1bafb588eb20a5d35df14e79a1a948885c721a
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2015-09-29_23:55:44
Locale: en-US (en_US.UTF-8)
Comment 1 Regina Henschel 2015-10-03 16:56:02 UTC
Please do not mix handling of ODF with problems in OOXML import and export.

ODF is very clear, how draw:style="square" should look. Read section 19.218.2<draw:gradient>, item 'square',
"square: defines a gradient that produces a square blend, imitating the visual perspective in a corridor or the aerial view of a pyramid. Also known as "box gradient" and "pyramidal gradient". The center of the square is defined with the draw:cx and draw:cy attributes. The width and height of the square is the minimum value of either the width or the height of the filled area. The outside of the square is filled with the end color."

LibeOffice shows it correctly in most cases. Only transparent gradient in presentation mode is wrong. The names in the UI are wrong for en-US. In German the gradients in Area dialog have the correct "Quadratisch" for draw:style="square" and "Rechteckig" for draw:style="rectangle", but German is wrong in the other cases too.

I think, not the drawing is wrong, but the naming in the UI.


OOXML import and export should be an own issue, but nevertheless a comment: OOXML has only the gradient types 'linear' and 'path based'. For 'path' it has the values 'circle', 'rect' and 'shape'. So there exists no direct mapping for ODF draw:style="square". Read annex L.4.8.4.2, and section 20.1.10.38 ST_PathShadeType, and section 20.1.8.33 gradFill; all in ECMA-376, 4th Edition; Office Open XML File Formats — Fundamentals and Markup Language Reference; December 2012. The nearest mapping would be to 'rect' and calculate its corner positions based on the current shape in a way, that the gradient area is a square.
Comment 2 Yousuf Philips (jay) (retired) 2015-10-03 20:28:18 UTC
Created attachment 119249 [details]
master vs 3.3

(In reply to Regina Henschel from comment #1)
> ODF is very clear, how draw:style="square" should look. Read section
> 19.218.2<draw:gradient>, item 'square',
> "square: defines a gradient that produces a square blend, imitating the
> visual perspective in a corridor or the aerial view of a pyramid. Also known
> as "box gradient" and "pyramidal gradient". The center of the square is
> defined with the draw:cx and draw:cy attributes. The width and height of the
> square is the minimum value of either the width or the height of the filled
> area. The outside of the square is filled with the end color."

If the ODF was very clear, calligra and MSO would show it the same way as LO currently shows it. When i read this, "The width and height of the square is the minimum value of either the width or the height of the filled area.", LO doesnt seem to follow this, as it doesnt alter the minimum square to the minimum width or height, as seen in the attached screenshot. It keeps the square as large as the maximum value of either the width or height.

> OOXML import and export should be an own issue, but nevertheless a comment:
> OOXML has only the gradient types 'linear' and 'path based'. For 'path' it
> has the values 'circle', 'rect' and 'shape'. So there exists no direct
> mapping for ODF draw:style="square". Read annex L.4.8.4.2, and section
> 20.1.10.38 ST_PathShadeType, and section 20.1.8.33 gradFill; all in
> ECMA-376, 4th Edition; Office Open XML File Formats — Fundamentals and
> Markup Language Reference; December 2012. The nearest mapping would be to
> 'rect' and calculate its corner positions based on the current shape in a
> way, that the gradient area is a square.

Would be great if you could provide a link to this, so i could read more about it. Word 2010 imports both ODF draw:style="square" and draw:style="rectangular" as rectangular gradient.
Comment 3 Regina Henschel 2015-10-04 12:56:38 UTC
Information about support of ODF 1.2 in Word, Excel and PowerPoint are available from https://msdn.microsoft.com/en-us/library/gg548604%28v=office.12%29.aspx. It is document [MS-OODF3]. (The other files might interest you too.)

ECMA-376 is available from http://www.ecma-international.org/publications/standards/Ecma-376.htm. You need part 1.

ISO/IEC 29500 is available from http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html. The ISO version is not on version 4th, but on version 3rd.


> If the ODF was very clear, calligra and MSO would show it the same way as LO
> currently shows it.

ODF 1.1 does not have such clear description, therefore applications have varied in the implementation. As LO claims to support ODF1.2, it should follow the standard.


> LO doesnt seem to follow this, as it doesnt alter the minimum square to the
> minimum width or height, as seen in the attached screenshot. It keeps the
> square as large as the maximum value of either the width or height.

You are right. LO does not render it as specified.
Comment 4 QA Administrators 2016-11-08 10:34:58 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2019-12-03 14:48:37 UTC Comment hidden (obsolete)
Comment 6 Regina Henschel 2019-12-03 15:44:18 UTC
Tested with Version: 6.5.0.0.alpha0+ (x64)
Build ID: 800b6f095f95ccfb8a7ba9755292332bf97f97ad
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: de-DE (en_US); UI-Language: en-US
Calc: threaded

Problems still not solved:
1. Wrong name in the English UI. File format draw:style="square" should be named "square" in the UI, and file format draw:style="rectangular" should be named "rectangular" in the UI.
2. The gradient with file format draw:style="square" is not drawn as specified in ODF 1.2.
3. The gradient with file format draw:style="square" is drawn different in edit mode and presentation mode.
Comment 7 QA Administrators 2021-12-03 04:40:48 UTC Comment hidden (obsolete)
Comment 8 Regina Henschel 2021-12-09 14:29:17 UTC
I have created an issue for the ODF TC, to add sample images to the specification. Till that is resolved, we should not change the current rendering.

There is no interoperability problem with MS Office, because MS Office does not distinguish "rectangular" and "square", which means, it is currently not able to evaluate the attribute. There is no interoperability problem with Apache OpenOffice, because it renders the same as LibreOffice.

Tested with Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 4ac9032163cf55c160145373e7c41741c9c339ca
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: CL
Comment 9 Regina Henschel 2021-12-13 18:57:43 UTC
The problem has been discussed in the ODF TC, https://lists.oasis-open.org/archives/office/202112/msg00029.html

The ODF TC sees differences in all application and considers to add further attributes to allow applications to draw the gradient as they used to do.

Open question is for example, whether the area of the gradient is related to the rectangle given by the svg:width and svg:height attributes or is related to the bounding rectangle of the shape. 

The old, version 3.5, way of drawing gradient "Gradient 4" of the example document, that has in file the attribute draw:style="square", is wrong. A square is defined to have same length for width and height and that is not the case in the old way of rendering. The new way has a square, but it does not follow the specification [1], that the _minimum_ of width and height has to be used as size.

The way of drawing gradient "Gradient 5" of the example document, that has in file the attribute draw:style="rectangular", is wrong too. According specification the gradient ends in the center given by draw:cx and draw:cy. That means that the gradient ends in a _point_, but in LibreOffice it ends in a line segment.

[1] https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/OpenDocument-v1.3-os-part3-schema.html#__RefHeading__1417216_253892949

Next step is to discuss, which kinds of gradient LibreOffice really wants and which additional attributes in file format are needed to describe the desired gradients unmistakably.