Bug 131124 - Export of drawing to jpg or png has initial zero width/height if it is 3D
Summary: Export of drawing to jpg or png has initial zero width/height if it is 3D
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0 all versions
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:26.8.0 target:26.2.0.2 target:...
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Shapes
  Show dependency treegraph
 
Reported: 2020-03-04 14:35 UTC by Regina Henschel
Modified: 2026-01-17 16:32 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file with extruded custom shape (10.43 KB, application/vnd.oasis.opendocument.text)
2026-01-06 22:29 UTC, Regina Henschel
Details
Example file with a Fontwork shape (13.52 KB, application/vnd.oasis.opendocument.text)
2026-01-06 22:31 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2020-03-04 14:35:15 UTC
Start Writer, insert a custom shape, e.g. "Diamond". Toggle Extrusion on. That icon is in the 'Drawing' toolbar.
Select the shape. Go to File > Export..., choose jpg or png. Make sure 'Selection' is checked. Enter file name and save. Now you should get the 'JPG Options' or 'PNG Options' dialog.
Notice, that the width and height fields have zero.

Expected: The fields are filled with the current size of the drawing.
Comment 1 Dieter 2020-03-15 16:59:13 UTC
I confirm it with

Version: 7.0.0.0.alpha0+ (x64)
Build ID: c63148ba139bd6b9ae7a0f9e24e51f29e5370963
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-GB
Calc: threaded
Comment 2 QA Administrators 2022-03-16 03:57:32 UTC Comment hidden (obsolete)
Comment 3 Regina Henschel 2022-03-16 08:46:01 UTC
The problem still exists in Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 89fb3f7e87fd7ab9312bc43dffea842ffc34b140
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

In addition, it is not possible to enter width and height manually, because when you enter one value the other will jump back to 0.
Comment 4 Kira Tubo 2023-11-03 05:09:11 UTC
Looks like a regression. 

Reproduced in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 676e0527d2f31556eccae314fbb12ce204f02ec7
CPU threads: 6; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

Version: 6.0.0.0.alpha1+
Build ID: 6eeac3539ea4cac32d126c5e24141f262eb5a4d9
CPU threads: 6; OS: Windows 10.0; UI render: GL; 
Locale: en-US (en_US); Calc: CL

Not reproduced in: 

Version: 5.4.0.0.alpha1 (x64)
Build ID: 0b9f9bef65bb21ebb6a64aafad448f7f62dc824a
CPU threads: 6; OS: Windows 6.19; UI render: default; 
Locale: en-US (en_US); Calc: CL
Comment 5 raal 2023-12-23 12:43:30 UTC
This seems to have begun at the below commit in bibisect repository/OS bibisect-linux-64-6.0.
Adding Cc: to Eike Rathke ; Could you possibly take a look at this one?
Thanks
 56837f9df68e6013502d917185cc38517df1efbd is the first bad commit
commit 56837f9df68e6013502d917185cc38517df1efbd
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Thu Sep 21 22:53:25 2017 +0200

    source 7c8db524248bacc1dfa22df7bad0ad81e31d63ca

42498: Writer export to PNG,JPG: switch to proper SvFilterOptionsDialog | https://gerrit.libreoffice.org/c/core/+/42498

--
Kira, thanks!
Comment 6 Eike Rathke (retired, only occasionally showing up) 2024-01-03 12:15:52 UTC
No time for this, please find someone else.
Comment 7 QA Administrators 2026-01-03 03:12:56 UTC Comment hidden (obsolete)
Comment 8 Regina Henschel 2026-01-03 10:43:37 UTC
The error still exists in Version: 25.8.4.2 (X86_64)
Build ID: 290daaa01b999472f0c7a3890eb6a550fd74c6df
CPU threads: 32; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded


The problem exists only in Writer. The export of the shape works without problems in Draw.
Comment 9 Regina Henschel 2026-01-03 11:52:28 UTC
The same problem exists for a Fontwork shape.

It seems the problem is, that the cases ShellMode::ExtrudedCustomShape and ShellMode::Fontwork are not handled in uno::Any SwXTextView::getSelection() in sw/source/uibase/uno/unotxvw.cxx. Thus mxShapes and mxShape in the Export dialog are empty and maSize is zero.
Comment 10 Regina Henschel 2026-01-03 15:26:55 UTC
Started in https://gerrit.libreoffice.org/c/core/+/196456
It is not complete because a unit test is missing.
Comment 11 Regina Henschel 2026-01-06 22:29:55 UTC
Created attachment 204953 [details]
Example file with extruded custom shape

This file could be used in a UITest.
Comment 12 Regina Henschel 2026-01-06 22:31:10 UTC
Created attachment 204954 [details]
Example file with a Fontwork shape

This file could be used in a UITest.
Comment 13 Commit Notification 2026-01-08 21:14:07 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

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

tdf#131124 Handle ExtrudedCustomShape and FontWork

It will be available in 26.8.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 14 Commit Notification 2026-01-09 21:09:23 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

https://git.libreoffice.org/core/commit/61d5485b76a323acf1c8c2d7eedb2637edea3be6

tdf#131124 Handle ExtrudedCustomShape and FontWork

It will be available in 26.2.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 15 Commit Notification 2026-01-10 14:01:58 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/1fb6b5ceb2c51d9af1720d6420e7019722adb26a

tdf#131124 Handle ExtrudedCustomShape and FontWork

It will be available in 25.8.5.

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 16 Dieter 2026-01-17 16:32:32 UTC
VERIFIED with

Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: 680(Build:0)
CPU threads: 12; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded

Regina, thank you for fixing it!