Skip to content

[BUG] 565 bmp doesn't import correctly #2808

Closed
@SRHMorris

Description

@SRHMorris

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions