Skip to content

Commit

Permalink
Merge pull request #10 from gc-locks/endian
Browse files Browse the repository at this point in the history
swap endianness when 16bit png
  • Loading branch information
ledyba-z authored Mar 8, 2020
2 parents 9db9447 + 90f0b4d commit 61f1dc8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/img/PNGReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ std::variant<avif::img::Image<8>, avif::img::Image<16>> PNGReader::read() {
png_set_tRNS_to_alpha(png);
}

if(bit_depth == 16) {
png_set_swap(png);
}

avif::img::PixelOrder pixelOrder = avif::img::PixelOrder::RGB;
// These color_type don't have an alpha channel then fill it with 0xff.
switch(color_type) {
Expand Down

0 comments on commit 61f1dc8

Please sign in to comment.