Bug 130573 - labels "4bit grayscale" and "4bit color" are exchanged in export to BMP
Summary: labels "4bit grayscale" and "4bit color" are exchanged in export to BMP
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
5.4 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.0.0 target:6.4.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2020-02-10 23:35 UTC by Regina Henschel
Modified: 2020-02-21 18:45 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
File for test of image export (1.33 MB, application/vnd.oasis.opendocument.graphics)
2020-02-10 23:35 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-02-10 23:35:59 UTC
Created attachment 157781 [details]
File for test of image export

Open attached document. Mark the image. Go to File > Export and choose export to BMP format and mark "Selection". You get a dialog, where you can select a color depth. Select item "4 bit grayscale". Finish. Open the generated image. Notice, that it is in color. Do the same with export in "4 bit color". Notice, that now a grayscale image is generated.
Comment 1 Xisco Faulí 2020-02-11 13:07:09 UTC
Reproduced in

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

but not in

Version: 5.2.0.0.alpha1+
Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8)
Comment 2 Julien Nabet 2020-02-11 13:26:52 UTC
On Win10 with master sources updated today, I could reproduce this.
Comment 3 Xisco Faulí 2020-02-11 13:29:40 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=b5699cd01b6a52906880c107bac6f3802ea7353d

author	Noel Grandin <noel.grandin@collabora.co.uk>	2017-02-08 16:18:32 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	2017-02-09 08:42:06 +0000
commit b5699cd01b6a52906880c107bac6f3802ea7353d (patch)
tree 131315b3755ddf31d56a5359b24a387d9e1ec2e0
parent f1c844fed0fdf898fd6d027529cb2570eb52bec5 (diff)
convert BmpConversion to scoped enum

Bisected with: bibisect-linux-64-5.4

Adding Cc: to Noel Grandin
Comment 4 Commit Notification 2020-02-14 07:09:02 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

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

tdf#130573 labels exchanged in export to BMP

It will be available in 7.0.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 5 Tomaz Vajngerl 2020-02-14 08:55:33 UTC
Don't see who really cares about 4-bit (and 1 bit) or 8-bit options. The right course of action would be to remove them to simplify our code.
Comment 6 Xisco Faulí 2020-02-14 11:49:07 UTC
(In reply to Tomaz Vajngerl from comment #5)
> Don't see who really cares about 4-bit (and 1 bit) or 8-bit options. The
> right course of action would be to remove them to simplify our code.

I believe this is something we could do towards LibreOffice 7.0, due to be released in August 2020.
Would you mind sending a short proposal to the mailing list? Later on, it can be discussed in the ESC meeting if needed
Comment 7 Xisco Faulí 2020-02-14 11:57:30 UTC
I just remembered Noel has a patch in gerrit for removing internal use of 4-bit images < https://gerrit.libreoffice.org/c/core/+/78833 > however it got abandoned a few days ago...
Comment 8 Noel Grandin 2020-02-14 12:07:50 UTC
(In reply to Xisco Faulí from comment #7)
> I just remembered Noel has a patch in gerrit for removing internal use of
> 4-bit images < https://gerrit.libreoffice.org/c/core/+/78833 > however it
> got abandoned a few days ago...

I got bored with chasing issues in the SVM stuff, anybody else is welcome to pick it up and finish it.
Comment 9 Xisco Faulí 2020-02-17 16:42:03 UTC
Verified in

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

@Noel, thanks for fixing this issue!
Comment 10 Commit Notification 2020-02-21 18:45:10 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

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

tdf#130573 labels exchanged in export to BMP

It will be available in 6.4.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.