Bug 134842

Summary: Export to PNG or JPG shrinks the image adding white borders; objects look shifted
Product: LibreOffice Reporter: LeroyG <iavs.leroy>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: erack, mgb1508, stephane.guillou, tac725, thurston.more, xiscofauli
Priority: medium Keywords: implementationError
Version: 6.0.0.3 release   
Hardware: All   
OS: All   
URL: https://ask.libreoffice.org/t/png-jpg-export-of-calc-sheet-with-shapes-shapes-shifted-vertically/95928
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=51510
https://bugs.documentfoundation.org/show_bug.cgi?id=134544
https://bugs.documentfoundation.org/show_bug.cgi?id=108317
https://bugs.documentfoundation.org/show_bug.cgi?id=152726
https://bugs.documentfoundation.org/show_bug.cgi?id=137263
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 108640, 109323    
Attachments: Sample .ods file
Resulting file from sample
Partial Black Border Example

Description LeroyG 2020-07-15 20:59:00 UTC
Description:
Exporting a cell, range of cells or sheet as .png or .jpg, adds white borders at right and bottom (sometimes left). Image is shrinked. Noticeable when using background color or borders.

Steps to Reproduce:
1. Apply background color or borders to a cell or range of cells.
2. If less than a page, select cell or range of cells.
2. Choose menu `File` - `Export…`, type file name, (check `Selection` if only is a cell, or range less than a page), `Save` - `OK`.

Actual Results:
Resulting image is shrunk and shows white borders.

Expected Results:
Background or border color seen up to the edge of the image.


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 6.3.6.2 (x86)
Build ID: 2196df99b074d8a661f4036fca8fa0cbfa33a497
CPU threads: 4; OS: Windows 6.1; UI render: default; VCL: win; 
Locale: es-MX (es_MX); UI-Language: en-US
Calc: threaded

Tryed with OpenGL disabled, and see no difference.
Comment 1 LeroyG 2020-07-15 21:00:44 UTC
Created attachment 163081 [details]
Sample .ods file
Comment 2 LeroyG 2020-07-15 21:02:31 UTC
Created attachment 163082 [details]
Resulting file from sample
Comment 3 Xisco Faulí 2020-07-16 10:00:41 UTC
Reproduced in

Version: 7.1.0.0.alpha0+
Build ID: d851a02df57ab378ed0cc6d9362516de09c3279c
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

and

Version: 6.1.0.0.alpha1+
Build ID: 3a801799536e6870f2fb111b1cc00b9575a35a39
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group

in previous versions, the whole page is exported even if the option selection is opted in
Comment 4 Telesto 2022-02-10 10:13:35 UTC
Repro
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 42c5506a9e9ef58efd8193a193464e3b49d481ca
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 5 flywire 2023-01-28 23:00:13 UTC
Created attachment 184983 [details]
Partial Black Border Example

Optionally add a border. Displaying this file on black background loses the partial black border detail on left-hand side.
Comment 6 Stéphane Guillou (stragu) 2023-09-06 22:52:49 UTC
I still see right and bottom white margins on selection export with:

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

In 5.4, the whole page is exported instead of the cell range.
In 6.0.0.3, cell range is exported but margin is already there.

I think it's an implementation error in the fix for bug 108317.
Eike, any opinion on it?
Comment 7 Eike Rathke 2023-09-13 18:03:31 UTC
I don't know. I'm not into this anymore after 6 years.
Comment 8 Stéphane Guillou (stragu) 2023-09-20 08:05:05 UTC
This issue also results in objects appearing shifted relative to the cell grid and text, see duplicate bug 152714 and e.g. attachment 189682 [details].
Comment 9 Stéphane Guillou (stragu) 2023-09-20 08:06:02 UTC
*** Bug 157293 has been marked as a duplicate of this bug. ***
Comment 10 Stéphane Guillou (stragu) 2023-09-20 08:06:31 UTC
*** Bug 152714 has been marked as a duplicate of this bug. ***