Bug 163381 - XBitmap.getMaskDIB() is inverted
Summary: XBitmap.getMaskDIB() is inverted
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0 target:24.8.3 target:24...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-10 19:11 UTC by jmmorlan
Modified: 2024-11-15 12:06 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Document with a partially transparent image embedded (24.95 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-10-11 20:09 UTC, jmmorlan
Details
Program using XBitmap API to extract transparency mask of image (2.40 KB, text/x-java)
2024-10-11 20:14 UTC, jmmorlan
Details
bitmap extracted (79.18 KB, image/bmp)
2024-10-12 08:51 UTC, Julien Nabet
Details
new extraction (79.18 KB, image/bmp)
2024-10-16 15:17 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jmmorlan 2024-10-10 19:11:24 UTC
In previous versions of LibreOffice, XBitmap.getMaskDIB() returned a transparency mask (0 = opaque, 255 = transparent).
In 24.2, it now returns an opacity mask (0 = transparent, 255 = opaque), the reverse of what existing programs expect.
Comment 1 Julien Nabet 2024-10-11 11:30:06 UTC
Just to allow QA people to test this quickly, could you provide a complete example? (eg: a file containing an image with transparency + macro)
Comment 2 jmmorlan 2024-10-11 20:09:30 UTC
Created attachment 197008 [details]
Document with a partially transparent image embedded
Comment 3 jmmorlan 2024-10-11 20:14:02 UTC
Created attachment 197009 [details]
Program using XBitmap API to extract transparency mask of image

run: /path/to/libreoffice7.6/program/soffice --headless --accept='socket,host=localhost,port=8000,tcpNoDelay=1;urp'
run: java -cp /path/to/libreoffice7.6/program/classes/\* ExtractMask.java
view logo-maskdib.bmp, see opaque areas are in black

run: /path/to/libreoffice24.2/program/soffice --headless --accept='socket,host=localhost,port=8000,tcpNoDelay=1;urp'
run: java -cp /path/to/libreoffice24.2/program/classes/\* ExtractMask.java
view logo-maskdib.bmp, see opaque areas are in white
Comment 4 QA Administrators 2024-10-12 03:13:04 UTC Comment hidden (obsolete)
Comment 5 Julien Nabet 2024-10-12 08:51:09 UTC
Created attachment 197016 [details]
bitmap extracted

On pc Debian x86-64 with master sources updated today or with LO Debian package 24.8.2.1, I got opaque areas in black (see attachment).

On which env are you? Would it be possible you give a try to 24.8 version?
Comment 6 jmmorlan 2024-10-15 19:30:51 UTC
I'm using Ubuntu 22.04 x86-64.

That image from 24.8 is the same as what I get with 24.2: the opaque logo/text are represented with white, the transparent background with black.
But this is the opposite of 7.6 and all earlier versions, where the opaque content is black and the transparent background is white.
Comment 7 Julien Nabet 2024-10-15 20:29:25 UTC
Noel: could it be related to the rework about transparency/alpha ?
Comment 8 Commit Notification 2024-10-16 14:58:09 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

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

tdf#163381 XBitmap.getMaskDIB() is inverted

It will be available in 25.2.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 9 Julien Nabet 2024-10-16 15:17:04 UTC
Created attachment 197090 [details]
new extraction

Here's the new extraction with master sources updated today.
Comment 10 Commit Notification 2024-10-16 18:50:43 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/1ebee6c662413d4d0c0218cd12435f4a39fc9582

tdf#163381 XBitmap.getMaskDIB() is inverted

It will be available in 24.8.3.

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 11 Commit Notification 2024-10-16 19:59:00 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/50c07bc4fc602887b48c36db82328e97b0395ff3

tdf#163381 XBitmap.getMaskDIB() is inverted

It will be available in 24.2.8.

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 12 Commit Notification 2024-10-22 09:15:21 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-24-2-7":

https://git.libreoffice.org/core/commit/654869813b7014830ee4d0ea345655c3d6086c65

tdf#163381 XBitmap.getMaskDIB() is inverted

It will be available in 24.2.7.

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.