AcademySoftwareFoundation / AcademySoftwareFoundation/OpenImageIO

Misinterpretation of some BMP files (A and B channels swapped?)

Open
#1,901 0 comments 0 reactions 0 assignees View on GitHub
bug file formats good first issue
Dominant language
C++
Stars
2.4k
Forks
698
Avg merge
3d 9h
Merged PRs (30d)
48

Description

### Problem

OIIO misinterprets https://raw.githubusercontent.com/NatronGitHub/Natron-Tests/master/TestImageBMP/input.bmp

**Expected behavior:**

R=G=B and A=1 everywhere

This is what ImageMagick, the macOS finder, and Xee application see.

**Actual behavior:**
The blue and alpha channels seem to be swapped.

### Steps to Reproduce

(`convert` is from ImageMagick 7)
```
iconvert input.bmp output-oiio.tif
convert input.bmp output-imagemagick.tif
```

### Versions

* OIIO branch/version: 1.8.9
* OS: macOS
* C++ compiler: clang

Contributor guide

Open the contributing guide

Research direction

Reproduce the report with input.bmp using `iconvert input.bmp output-oiio.tif` and compare it with the ImageMagick conversion. Trace the BMP decoding path and verify the channel values against the expected R=G=B and A=1 result; the completed work should preserve the correct channel order and include a regression check for this image.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.