Bug 134842 - Export to PNG or JPG shrinks the image adding white borders; objects look shifted
Summary: Export to PNG or JPG shrinks the image adding white borders; objects look shi...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL: https://ask.libreoffice.org/t/png-jpg...
Whiteboard:
Keywords: implementationError
: 152714 157293 (view as bug list)
Depends on:
Blocks: Object Graphics-Export
  Show dependency treegraph
 
Reported: 2020-07-15 20:59 UTC by LeroyG
Modified: 2023-09-20 08:06 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample .ods file (9.82 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-07-15 21:00 UTC, LeroyG
Details
Resulting file from sample (1.44 KB, image/png)
2020-07-15 21:02 UTC, LeroyG
Details
Partial Black Border Example (4.90 KB, image/png)
2023-01-28 23:00 UTC, flywire
Details

Note You need to log in before you can comment on or make changes to this bug.
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. ***