lvandeve / lodepng

PNG encoder and decoder in C and C++.
zlib License
2.04k stars 420 forks source link

example_bmp2png.cpp process 32bit bmp incorrectly #112

Closed roytam1 closed 4 years ago

roytam1 commented 4 years ago

it should be in this:

    } else {
      image[newpos + 0] = bmp[bmpos + 2]; //R
      image[newpos + 1] = bmp[bmpos + 1]; //G
      image[newpos + 2] = bmp[bmpos + 0]; //B
      image[newpos + 3] = bmp[bmpos + 3]; //A
    }
lvandeve commented 4 years ago

Thank you for reporting this. Do you happen to have an example 32bit bmp image to test this on?

roytam1 commented 4 years ago

sure. this file is created by firefox's "set as desktop background" function. Desktop Background.zip

lvandeve commented 4 years ago

Thanks!

Fixed in commit https://github.com/lvandeve/lodepng/commit/957506a7c21db4000685dae340034253834e37da