Bug 156236 - SVG import: rect element with rx="0" uses ry value instead (and vice-versa)
Summary: SVG import: rect element with rx="0" uses ry value instead (and vice-versa)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
6.0 all versions
Hardware: All All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:24.2.0 target:7.6.0.2
Keywords: filter:svg
Depends on:
Blocks: SVG-Import
  Show dependency treegraph
 
Reported: 2023-07-11 12:19 UTC by Stéphane Guillou (stragu)
Modified: 2023-07-18 07:55 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
sample SVG (408 bytes, image/svg+xml)
2023-07-11 12:22 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Guillou (stragu) 2023-07-11 12:19:38 UTC
If the property rx is 0, LO will import it as equal of the non-zero positive value of ry (and vice versa).

Steps to reproduce:
1. Open attachment in e.g. Firefox or Chrome, observe that bottom-left rect element is displayed as a square.
2. Open attachment in LO

Result: bottom-left rect is displayed with rounded corners consistent with values of rx=15 and ry=15.

Expected: right-angle corners, just like in Firefox or Chrome.

Tested in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 77fca616e0bd79e0b405fd0b3543cf8e94e15df3
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Regression as not present in 6.0:

Version: 6.0.0.3
Build ID: 64a0f66915f38c6217de274f0aa8e15618924765
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk2; 
Locale: en-AU (en_AU.UTF-8); Calc: group

Bibisected with linux-64-6.1 to first bad commit 2c183ed370c1e381ffaa14cb1507df84716333da which points to core commit:

commit 3ca7be09834a26fbd1c371deabd7a58111092676
author	Armin Le Grand <Armin.Le.Grand@cib.de>	Thu May 10 17:49:19 2018 +0200
committer	Armin Le Grand <Armin.Le.Grand@cib.de>	Fri May 18 20:11:35 2018 +0200
Replace SVGFilter using SVGIO

Armin and Xisco, can you please have a look?

--- Further info

"If a properly specified value is provided for rx but not for ry (or the opposite), then the browser will consider the missing value equal to the defined one."
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/rx#rect

For the rx or ry properties, the value "0" is valid: https://svgwg.org/svg2-draft/geometry.html#RX

Related svg-native-viewer patch: https://github.com/adobe/svg-native-viewer/issues/69

Inkscape 1.2.2 imports it like LO, but see corresponding bug reports:
- https://bugs.launchpad.net/inkscape/+bug/1533302
- https://gitlab.com/inkscape/inbox/-/issues/6875
Comment 1 Stéphane Guillou (stragu) 2023-07-11 12:22:59 UTC
Created attachment 188312 [details]
sample SVG

from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/rx
Comment 2 Stéphane Guillou (stragu) 2023-07-11 12:25:28 UTC
Sorry for the noise, Armin.
Insert > Image would reproduce the bug before your commit.
Comment 3 Commit Notification 2023-07-12 04:35:57 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f7af4c311ad04ce5e54e08b9d7ccd71b75b7a32d

tdf#156236: For the rx or ry properties, "0" is valid

It will be available in 24.2.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.
Comment 4 Commit Notification 2023-07-12 08:50:32 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/f6df2e640342b6114e46b7957de093386ad35459

tdf#156236: For the rx or ry properties, "0" is valid

It will be available in 7.6.0.2.

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.
Comment 5 Stéphane Guillou (stragu) 2023-07-18 07:55:30 UTC
Fix verified in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 46d7119b8be03968017e59d882e5671350304e15
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thanks Xisco!