Negative RGB mapping indices are accepted
Open
Beginner friendly
- Dominant language
- Python
- Stars
- 21
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
`prepare_for_display()` validates only the upper bound of `rgb_mapping` indices. Negative indices therefore pass validation and use NumPy negative indexing, silently selecting channels from the end of the image.
For a 4-channel image, `rgb_mapping=[-1, 0, 1]` is accepted and maps channel 3 into red instead of rejecting the invalid mapping.
Contributor guide
Research direction
Locate the prepare_for_display() entry point and inspect how rgb_mapping indices are validated before NumPy indexing. Verify that negative indices are rejected while valid mappings continue to work, and add or update focused tests for the four-channel example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100