Bug 128731 - exporting a selection when there is no selection crops the page margins
Summary: exporting a selection when there is no selection crops the page margins
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: notBibisectable, regression
Depends on:
Blocks: Graphics-Export
  Show dependency treegraph
 
Reported: 2019-11-12 08:49 UTC by csongor
Modified: 2023-09-06 22:32 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
This is the drawing that can be exported in two different ways (8.60 KB, application/vnd.oasis.opendocument.graphics)
2019-11-12 08:49 UTC, csongor
Details
result if eveything has been selected by Ctrl+A (4.72 KB, image/png)
2019-11-12 08:50 UTC, csongor
Details
result ifnothing has been selected before exporting (7.59 KB, image/png)
2019-11-12 08:51 UTC, csongor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description csongor 2019-11-12 08:49:43 UTC
Created attachment 155726 [details]
This is the drawing that can be exported in two different ways

I have a drawing in which some part of the content is on the margin.

When I File -> Export -> Selection into a png file then I can get two different results:
- if I selected everything before via Ctrl+A then I get the bitmap containing everything. This is what I expect.
- if I did not select anything then I get only a part of the bitmap. The content on the margin is cropped off.

I think if nothing is selected then one the following scenarios should happen:
- raise an error message saying there is no selection no export
- pretend as if everything had been selected and work accordingly.

I would happy with any of these solutions but the current solution is quite counterintuitive.
Comment 1 csongor 2019-11-12 08:50:41 UTC
Created attachment 155727 [details]
result if eveything has been selected by Ctrl+A
Comment 2 csongor 2019-11-12 08:51:21 UTC
Created attachment 155728 [details]
result ifnothing has been selected before exporting
Comment 3 Gerhard Weydt 2019-11-20 16:39:01 UTC
I cannot confirm the behaviour as described, but there is a small difference: A line a placed on th e edge of the magin is printed when i select all, but not if nothing is selected. I then tested your file proof.odg, the results were the some for both cases.
I tested with
Version: 6.3.3.2 (x64)
Build-ID: a64200df03143b798afd1ec74a12ab50359878ed
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded
Comment 4 Xisco Faulí 2019-12-26 15:33:26 UTC
Could you please paste the info from Help - about LibreOffice ?

I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' once the information has been provided
Comment 5 csongor 2020-01-01 13:16:24 UTC
My previous LO version was:

Version: 6.3.0.4 (x64)
Build ID: 057fc023c990d676a43019934386b85b21a9ee99
CPU threads: 12; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-AU (en_AU); UI-Language: en-US
Calc: threaded

I did this:

- open "proof.odg" (first attachment in this ticket)
- do NOT select anything
- File -> Export ... -> save as type=PNG, checkbox "Selection" is ticked (!), File name="a.png", Save
- in the PNG options dialog, keep all the default values and keep the two checkboxes ticked. 
- click OK
- open the resulting a.png in an image viewer. It contains only the lower right quarter of the ellipse, plus a huge clear transparent area. (*)

- keep the odt file open
- Edit -> Select All
- File -> Export ... -> save as type=PNG, checkbox "Selection" is ticked (!), File name="b.png", Save
- in the PNG options, keep all the default values and keep the two checkboxes ticked. 
- click OK
- open the resulting b.png in an image viewer. It contains the whole ellipse within its bounding box, including the part that is beyond the margin, but nothing else.

My original complaint in the first comment of this ticket needs a clarification. In the first case a large png is generated that contains everything _within the margins_ but nothing beyond them. In the second case the selected objects are exported, even if they are beyond the margins.

I installed the new version:

Version: 6.3.3.2 (x64)
Build ID: a64200df03143b798afd1ec74a12ab50359878ed
CPU threads: 12; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-AU (en_AU); UI-Language: en-US
Calc: threaded

and the behaviour is still the same. 

I still believe that hiding this difference is confusing. If the user, by accident, puts an object partly beyond the margins then the exported image will be silently truncated.

Instead of the current behaviour, LO should ask the following dialog, when Export Selection is ticked but nothing was selected. 

> Nothing is selected. What do you want to export?
> [Everything, even beyond margins]
> [Everything within the margins]
> [Nothing, I will select something]
Comment 6 Gerhard Weydt 2020-01-01 13:55:57 UTC
I can now confirm the bug, following your instructions I get the same result as you, in 6.3.3.2 as well as in 
Version: 6.4.0.0.alpha1 (x64)
Build ID: cc57df8f942f239d29cb575ea5a7cb01405db787
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-GB
Calc: threaded
Comment 7 Aron Budea 2021-08-11 02:26:14 UTC
For the record, with gen VCL plugin in Linux, since 4.1.0.4 the Selection check box is greyed out if there's no selection, however gtk(3) VCL plugins don't follow that.

In addition, when it was possible to tick it without selection (in 4.0.0.3), the complete shape was included in the export. And that was actually the same on Windows in that version, and the behavior changed with 4.1.0.4. Too bad there isn't a 4.1 Windows bibisect repo, and in Linux the gtk VCL plugin in those old builds fail to work in recent Linux versions, thus the regression isn't bibisectable.
Comment 8 Som C 2023-05-09 21:47:46 UTC Comment hidden (off-topic)
Comment 9 Grantler 2023-06-16 09:33:34 UTC Comment hidden (off-topic)
Comment 10 Grantler 2023-06-17 09:41:16 UTC Comment hidden (off-topic)
Comment 11 Stéphane Guillou (stragu) 2023-09-06 22:32:42 UTC
(In reply to Som C from comment #8)
> Hello from Fedora 38, LO 7.5.3.2.
> Exporting selected area to JPEG or GIF works fine. So one can work around
> the issue.

(In reply to Grantler from comment #9)
> LinuxMint 21.1-64; Mate 1.26.0; LibreOffice 7.5.4.2 from PPA -
> LibreOffice Draw exports draw objects (selection) to PNG and creates a file
> of zero bytes.

Som and Grantler, please see the already-fixed bug 154168. The issue should be gone in 7.5.5.
I'm marking the comments as "off-topic" for clarity, please don't take it personally :)

As for the original issue, I can still reproduce in:

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