Problem writing bmp file - using RLE when in 2 color mode
GIMP version: 2.10.22
Operating System: Windows 10
Package: Installer from gimp.org
Description of the bug
BMP file created as corrupt file when saving in 2 color mode, having just previously used 256 color mode
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- Start GIMP.
- Set background color to white.
- Create New image 300x300 pixels.
- Use rectangle select to draw a box on image.
- Select foreground color Red and use bucket fill on this box.
- Draw another box and this time fill with Blue.
- Change Image Mode to Indexed and tick Generate optimum palette and set maximum number of colors to 256.
- Export as file Test1.bmp and when the options come up select Run-length encoding.
- Set Image mode to RGB.
- Set image mode to Indexed and tick Generate optimum palette and set maximum number of colors to 2.
- Export as Test2.bmp (this time you are not offered any options)
- File Test2.bmp has been written incorrectly, having applied RLE even though this is invalid for bit depth of 1
- If you close Test2.bmp and then reopen it, a corrupted image is shown.
Expected result: Valid bmp file
Actual result: Corrupt bmp file
Additional information
If you have a backtrace for a crash or a warning, paste it here.
Edited by PJB146