Only read BMP pixel data from stream in LoadBMPData()
This makes the code much more clear: LoadDib() now reads all the header
data while LoadBMPData() reads bitmap data only and doesn't read any
header values any more, unlike before.
It also allows not to have to pass neither bmpOffset nor IsBmp
parameters to LoadBMPData(), making its argument list much more
reasonable.
Finally, and, most importantly, it fixes loading bitmaps using
BI_BITFIELDS that was broken back in cccda9ef6b (Fix loading colour
palette from BMP file, 2019-12-28).
This commit also adds a unit test checking that this doesn't get broken
again without anyone noticing.
See #18634.
Closes #22499.
This commit is contained in:
parent
187a4b4385
commit
3ffc739e0e
8 changed files with 57 additions and 31 deletions
|
|
@ -164,6 +164,8 @@ void ImageTestCase::LoadFromFile()
|
|||
INFO("Loading " << file);
|
||||
CHECK(img.LoadFile(file));
|
||||
}
|
||||
|
||||
CHECK(img.LoadFile("image/bitfields.bmp", wxBITMAP_TYPE_BMP));
|
||||
}
|
||||
|
||||
void ImageTestCase::LoadFromSocketStream()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue