Bug 135303

Summary: Bitmap Export: Export color bitmap(.bmp) in spite of setting 4bit grayscale
Product: LibreOffice Reporter: sawakaze <souichirho>
Component: DrawAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: buzea.bogdan, himajin100000
Priority: medium    
Version: 7.0.0.1 rc   
Hardware: All   
OS: All   
Whiteboard: target:7.1.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 108254    
Attachments: ScreenCast

Description sawakaze 2020-07-30 09:58:02 UTC
Description:
In spite of 4bit gray scale, color image exported.
detail is following step and screencast.


Steps to Reproduce:
1. open draw
2. set color object
3. file > export...
-> popup Export diagram
4. set filename and file type to "BMP - Windows Bitmap"
5. press save button
-> popup "BMP options" dialog
6. set  Color Depth to "4bit grayscale" and OK
--> export bitmap image, but bitmap image is color...


Actual Results:
export color image.

Expected Results:
export gray scale image


Reproducible: Always


User Profile Reset: Yes



Additional Info:
note: if step6, set Color Depth to "4bit Color" -> export gray scale image.
i think 4bit color/grayscale is reverse.

I confirm following version.

Version: 7.0.0.2
Build ID: c01aa64b6c3d89ebe5fe69c28c7adb24eb85249c
CPU threads: 4; OS:Linux 4.15; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP.UTF-8); UI: ja-JP
Calc: threaded
Comment 1 sawakaze 2020-07-30 09:58:25 UTC
Created attachment 163757 [details]
ScreenCast
Comment 4 himajin100000 2020-08-02 05:45:10 UTC
added to CC list: 

Noel Gradin, who submitted https://gerrit.libreoffice.org/c/core/+/92841/2/include/vcl/bitmap.hxx

https://gerrit.libreoffice.org/c/core/+/99914

--
>note: if step6, set Color Depth to "4bit Color" -> export gray scale image.
i think 4bit color/grayscale is reverse.

I think I have to rethink.

Now I wonder why the color depth is not always treated as 0, even with the difference in plurality
Comment 5 himajin100000 2020-08-02 09:03:14 UTC
ok, now I got it.

https://opengrok.libreoffice.org/xref/core/vcl/source/filter/graphicfilter.cxx?r=0c600458#1849

https://opengrok.libreoffice.org/xref/core/vcl/source/filter/graphicfilter.cxx?r=0c600458#552

Is there any possibility that an image will go through both these two routine(one with "Colors", and one with "Color"?, and will that produce unexpected result?
Comment 6 Noel Grandin 2020-08-13 12:51:52 UTC
Sorry, no idea
Comment 7 Commit Notification 2020-09-23 07:07:39 UTC
Tomoyuki Kubota committed a patch related to this issue.
It has been pushed to "master":

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

tdf#135303

It will be available in 7.1.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 8 himajin100000 2020-09-27 01:10:37 UTC
even after my patch, this bug still seems reproducible.
Comment 9 QA Administrators 2022-09-28 03:32:46 UTC Comment hidden (obsolete)