After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697431 - 32bit BMP file of αlpha channel is not recognized
32bit BMP file of αlpha channel is not recognized
Status: RESOLVED OBSOLETE
Product: GIMP
Classification: Other
Component: General
2.8.4
Other All
: Normal normal
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
: 697430 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-04-06 13:34 UTC by tridentmm456
Modified: 2018-05-24 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
(Image in the center is transparent circle) read in GIMP28 (1.75 KB, application/octet-stream)
2013-04-06 15:49 UTC, tridentmm456
Details
(Image in the center is transparent circle) created in GIMP26 (1000.05 KB, image/bmp)
2013-04-06 15:50 UTC, tridentmm456
Details
(Image in the center is transparent circle) created in GIMP28 (1000.13 KB, image/bmp)
2013-04-06 15:55 UTC, tridentmm456
Details
(Image in the center is transparent circle) created in GIMP26 (1000.05 KB, image/bmp)
2013-04-06 15:55 UTC, tridentmm456
Details
a valide bmp that GIMP can't read. (64.05 KB, image/bmp)
2014-01-29 09:02 UTC, Lesbros
Details

Description tridentmm456 2013-04-06 13:34:55 UTC
Alpha channel does not recognize it and to read BMP files of 32bit
In addition, even if the export by selecting the 32bit BMP (A8 R8 G8 B8)
α is not stored.
Portable, Linux, both.
Comment 1 kasai6666 2013-04-06 13:43:05 UTC
*** Bug 697430 has been marked as a duplicate of this bug. ***
Comment 2 Téo Mazars 2013-04-06 14:56:16 UTC
Please, can you attach here an XCF file and the resulting BMP export showing the bug.

Also, how do you know that the alpha channel is not stored? I mean, what software do you use?

Thanks!
Comment 3 tridentmm456 2013-04-06 15:49:24 UTC
Created attachment 240846 [details]
(Image in the center is transparent circle) read in GIMP28
Comment 4 tridentmm456 2013-04-06 15:50:24 UTC
Created attachment 240847 [details]
(Image in the center is transparent circle) created in GIMP26
Comment 5 tridentmm456 2013-04-06 15:55:15 UTC
Created attachment 240849 [details]
(Image in the center is transparent circle) created in GIMP28
Comment 6 tridentmm456 2013-04-06 15:55:38 UTC
Created attachment 240850 [details]
(Image in the center is transparent circle) created in GIMP26
Comment 7 tridentmm456 2013-04-06 16:06:34 UTC
report in detail

There is a clear circle in the center of all images

GIMP26.bmp
create GIMP2.6 > GIMP2.6 read OK / GIMP2.8 read NG(alpha channel loss)

GIMP28.bmp
create GIMP2.8 > GIMP2.8 read OK

GIMP28-create.xcf
create GIMP2.8

GIMP28-READ.xcf
read GIMP26.bmp

Adding
read the images created in other tools bmp(RGBA)

GIMP26 > alpha is not lost
GIMP28 > alpha is lost
Comment 8 Téo Mazars 2013-04-06 16:33:55 UTC
Thanks.


First, among all three bmp files attached here, only 240849 is a "real" 32bpp-RGBA file. It's a BITMAPV5HEADER BMP file.

The two others files are ambiguous since BMP specification (BITMAPINFOHEADER) is not clear about the alpha channel in 32bpp files. There is no way to know if 4th channel bits must be read or ignored. Thus it's best to ignore the extra bytes and this is what GIMP 2.8 does.

Unfortunatly, it seems that previous versions of GIMP were only saving BMP using BITMAPINFOHEADER, so in a file format that doesn't explicitly support 32bpp RGBA.

I am not sure about what should be done here, if something should be.



PS : It seems that Firefox doesn't handle BITMAPV5HEADER's ChannelsMasks correctly...
Comment 9 Lesbros 2014-01-29 09:02:32 UTC
Created attachment 267483 [details]
a valide bmp that GIMP can't read.
Comment 10 Lesbros 2014-01-29 09:04:55 UTC
Hi,
I can't read this file TestImTyrfiomokifavuigapipaumipau50Std.bmp 
with GIMP 2.8.10 under Windows.
Comment 11 Téo Mazars 2014-01-30 19:41:25 UTC
@Lesbros: Thanks for reporting this :) It was not related to the handling of the alpha channel though. Fixed in 2.8 and master.

commit 76ee47eff95e8dfad303d473c8a54b15720c83c0
Author: Téo Mazars <teomazars@gmail.com>
Date:   Thu Jan 30 20:31:26 2014 +0100

    plug-ins: don't check biClrUsed if bpp > 8 (in bug 697431)
    
    (cherry picked from commit 54f83a5ba273e45a9184f13d1f4b0f5697d56555)
Comment 12 Michael Schumacher 2014-02-05 21:11:00 UTC
Reopening. Please handle unrelated issues in new bug reports.
Comment 13 Michael Natterer 2014-02-06 08:13:08 UTC
Why reopening? I thought Téo fixed the bug (comment 11)?
Comment 14 Michael Schumacher 2014-02-06 13:34:16 UTC
Lesbros' comment and Téo's patch were unrelated to the original bug report, apparently.
Comment 15 Ofnuts 2014-03-18 15:01:45 UTC
My Gimp 2.8.2 Linux works fine, but my Windows 2.8.4 ignore the alpha channel. Regression?
Comment 16 Téo Mazars 2014-03-18 18:22:16 UTC
2.8.4 is old. Please try the latest stable release and report back if you still think there is something wrong.
Comment 17 Ofnuts 2014-03-20 00:45:37 UTC
Still applies to a freshly downloaded and installed 2.8.10 Windows.
Comment 18 Téo Mazars 2014-03-20 05:54:06 UTC
So, I guess Comment 8 applies to your issue too? You can paste a small image showing the bug if you want to make sure.
Comment 19 Ofnuts 2014-03-21 08:23:25 UTC
OK, the image wih which I can reproduce the problem has a BITMAPINFOHEADER (40 bytes), so case closed. 

But the best course of action should not be to discard bytes... may be the user could be asked what to do?
Comment 20 Téo Mazars 2014-03-21 12:48:35 UTC
This is feasible, but then all users would be asked each time they open a BITMAPINFOHEADER-32bpp image (95% of bmp images in the wild) if they want or not to discard the 4th channel...

Does it worth the cluttering? It doesn't in my opinion, but that's just an opinion.
Comment 21 Michael Natterer 2014-03-29 00:29:28 UTC
Why is this bug NEEDINFO?
Comment 22 Téo Mazars 2014-04-17 17:32:40 UTC
I don't know, isn't you that put the NEEDINFO status? Otherwise the right status "What do we do with that issue".
Comment 23 Téo Mazars 2014-04-17 17:34:46 UTC
Argh,

"... the right status would be ..."
Comment 24 Michael Natterer 2014-04-18 14:57:36 UTC
Indeed :)
Comment 25 trlkly 2016-05-11 21:07:37 UTC
Given Comment 20, I'd think the correct course of action would be to simply always load the alpha channel from a BITMAPINFOHEADER if present, but save properly as a V5 upon export. Ignoring bytes is obviously the wrong answer if it cuts off data for 95% of BMPs in the wild.

What I've read is that GIMP is supposed to be tolerant on import but exact on save/export. 

What reason is there to expect that there would be data that is intended to be discarded? If there is any such reason, is there not some way to tell if it would make sense as an alpha channel instead?
Comment 26 Andrey 2016-05-20 23:35:03 UTC
The problem is not the data to be discarded, but an ambiguity between ARGB and XRGB formats.
Which uplimately leading to image corruption, if mishandled.
Comment 27 GNOME Infrastructure Team 2018-05-24 13:39:33 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/461.