Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

BMP Decoding #71

Closed
bedalton opened this issue Jan 19, 2022 · 0 comments
Closed

BMP Decoding #71

bedalton opened this issue Jan 19, 2022 · 0 comments
Labels

Comments

@bedalton
Copy link

There is a problem with BMP decoding. The padding is calculated as 4 - (bytesPerRow % 4). Which means when the width is exactly divisible by 4, you have a padding of 4. This messes up the image considerably.

The check should probably be:if (padding != 4) { instead of if (padding != 0){

https://github.com/korlibs/korim/blob/d05eff45d0cb156336cf8dd9557731a3ec9243cb/korim/src/commonMain/kotlin/com/soywiz/korim/format/BMP.kt#L59

https://github.com/korlibs/korim/blob/d05eff45d0cb156336cf8dd9557731a3ec9243cb/korim/src/commonMain/kotlin/com/soywiz/korim/format/BMP.kt#L65

@soywiz soywiz added this to Korlibs Jan 19, 2022
@soywiz soywiz moved this to Backlog in Korlibs Jan 19, 2022
@soywiz soywiz added the bug label Jan 19, 2022
Repository owner moved this from Backlog to Done in Korlibs Feb 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants