#369 closed bug (fixed)
BMP Translator. The alpha value is lost.
Reported by: | Owned by: | marcusoverhagen | |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications | Version: | |
Keywords: | Cc: | diver | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
BMPTranslator.cpp
translate_from_bmpnpal_to_bits()
for (uint32 i = 0; i < msheader.width; i++) {
- memcpy(pBitsPixel, pBmpPixel, 3);
+ memcpy(pBitsPixel, pBmpPixel, bmpBytesPerPixel);
pBitsPixel += 4; pBmpPixel += bmpBytesPerPixel;
}
Attachments (2)
Change History (15)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Summary: | BMP Translator. The alpha value is lost. → BMP Translator. The alpha value is lost. |
---|
comment:3 by , 19 years ago
BTW, translate_from_bmppal_to_bits() seems to be broken in a similar way
comment:5 by , 19 years ago
Owner: | changed from | to
---|
comment:6 by , 19 years ago
Status: | new → assigned |
---|
comment:8 by , 19 years ago
Cc: | added |
---|
comment:9 by , 19 years ago
I'm just looking at the BMP translator right now and it is really poorly written with regards ot performance. memcpy(..., ..., 3) in the innermost loop everywhere. That's really bad. I've also come across clearing out the destination buffer with zeros and then filling it with pixel data in the next loop. Completely unnecessary.If the translator returns B_RGB32, then it is not expected to set the last byte (alpha), but if it is returning B_RGBA32, then it is expected to write alpha.I don't know enough about BMP to know if it actually supports alpha (but I would assume it does). The translator needs a complete overhaul.
comment:10 by , 19 years ago
Looks like this bug has been fixed. At least the Menu app shows its bitmaps correctly.
comment:11 by , 19 years ago
Thanks. It became beautiful.
It is anxious for a moment. translate_from_bits_to_bmp24() {
.....
if (fromspace == B_CMAP8) {
pmap = system_colors();
- if (!pmap)
+ if (!pmap) { + delete[] bmpRowData; + delete[] bitsRowData
return B_ERROR;
+ }
}
comment:12 by , 19 years ago
Resolution: | → fixed |
---|
comment:13 by , 19 years ago
Status: | assigned → closed |
---|
Can somebody look into this ? I am not really into that kind of stuff...