Bug 100451 - 4-bit image in WMF inserted into document is mishandled in PDF export when OpenGL is used
Summary: 4-bit image in WMF inserted into document is mishandled in PDF export when Op...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard: target:5.3.0 target:5.2.0.1 target:5.1.5
Keywords:
Depends on:
Blocks: VCL-OpenGL
  Show dependency treegraph
 
Reported: 2016-06-17 11:27 UTC by Tor Lillqvist
Modified: 2016-10-25 18:54 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tor Lillqvist 2016-06-17 11:27:42 UTC
If you insert a WMF that includes a 4-bit image into a Writer document, and export it as PDF while OpenGL is being used, the image looks very wrong in the resulting PDF. The colours are inverted (at least in the sample case I am looking at) and additionally there is some randomise looking noise in the background.

Unfortunately the sample WMF can not be made publicly available without asking the customer for permission. Will do.
Comment 1 Tor Lillqvist 2016-06-17 11:35:05 UTC
Ideally I would love to see all internal use of anything except 1bpp (black&white) and 24bpp (full colour) images ("Bitmaps") in LibreOffice go away. There is really no need for palettized colour modes to survive in this century, I think. Such images should be turned into the corresponding 24bpp ones whenever read in, and all code inside LO to handle such formats back and forth could then be dropped. But that is just my opinion; of course it is possible that doing that would have a significant negative impact on performance or resource use in some pathological but not uncommon cases, or whatever.
Comment 2 Tor Lillqvist 2016-06-17 15:51:57 UTC
Looking closer at the WMF, it first has one 1bpp image that is StretchBlt:ed with SRCPAINT, then a 4bpp one that is StretchBlted to the same place with SRCAND. I would assume that it is the 4bpp one that is mishandled, though.
Comment 3 Commit Notification 2016-06-21 06:54:16 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c2fc93cae194a1aad94721edc51078b168a34f5f

tdf#100451 convert texture buffer to 1-bit and 4-bit palette buffer

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2016-06-21 11:04:39 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=60b74fe1775e647545d2da1fcc58a4c63ec18aa5&h=libreoffice-5-2

tdf#100451 convert texture buffer to 1-bit and 4-bit palette buffer

It will be available in 5.2.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2016-06-23 09:44:17 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ebad0ff6da52d3f3bf9ca026ed2699df0673ce76&h=libreoffice-5-1

tdf#100451 convert texture buffer to 1-bit and 4-bit palette buffer

It will be available in 5.1.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.