OpenImageIO icon indicating copy to clipboard operation
OpenImageIO copied to clipboard

[BUG] 565 bmp doesn't import correctly

Open SRHMorris opened this issue 4 years ago • 0 comments

Describe the bug OIIO fails to import BMPs correctly when the bits per sample is less than 8. For example this attached image I think is 565 (zipped as github won't let me upload a bmp).

bmp.zip

iinfo states that oiio:BitsPerSample is 4. The code here seems to mask for 555 but then shift as if it's 444. I notice that the DibInformationHeader class has red/green/blue_mask members, but they don't seem to be used.

Even assuming the correct masking and shifting was being done, the data should probably be rescaled to 8 bit anyway.

Loading the image in the zip I get this:

bad

wheras I expect it to look like this:

good

Platform information:

  • OIIO branch/version: 2.2.9
  • OS: windows 10
  • C++ compiler: msvc
  • Any non-default build flags when you build OIIO:

SRHMorris avatar Jan 04 '21 12:01 SRHMorris