BMPs are wrongly read
Bug description
All BMP files I tested were wrongly read by BMPReadWriter (but BMPReadWriterTest passes).
To Reproduce
This is one BMP:
response := ZnEasy get: 'https://cdn-learn.adafruit.com/assets/assets/000/074/681/original/purple.bmp?1555717198'.
'original.bmp' asFileReference
ensureDelete;
binaryWriteStreamDo: [ :stream | stream nextPutAll: response contents ].
parsedForm := (BMPReadWriter on: response contents readStream) nextImage.
parsedForm writeBMPfileNamed: 'parsed.bmp'.
In an external tool, open both BMPs to see the difference. You can also inspect the forms inside Pharo IDE. You can also download externally the original file, in a web browser: https://cdn-learn.adafruit.com/assets/assets/000/074/681/original/purple.bmp?1555717198' and open it in your operating system.
I discovered this bug when playing with on Windows with the Clipboard API of SDL3 bindings. On this OS, when I right click on any image in the browser and choose "Copy" and then in Pharo-SDL3 bindings you "paste" and have to parse a byte array with the mime type "image/bmp". So, I use BMPReadWriter and get a wrongly parsed Form.
Screenshots
Original:
Parsed:
Version information:
Checked with a Pharo Version 12 in two OSs: Windows 11 and MacOS 15.4.1.