Skip to content

Commit

Permalink
Merge pull request python-pillow#7401 from radarhere/bc5s
Browse files Browse the repository at this point in the history
Fixed bug when reading BC5S DDS images
  • Loading branch information
radarhere authored Sep 20, 2023
2 parents 8934081 + 96e3534 commit 8d81fd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file modified Tests/images/bc5s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/libImaging/BcnDecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ decode_bc3_alpha(char *dst, const UINT8 *src, int stride, int o, int sign) {
if (sign == 1) {
bc5s_alpha b;
memcpy(&b, src, sizeof(bc5s_alpha));
a0 = (b.a0 + 255) / 2;
a1 = (b.a1 + 255) / 2;
a0 = b.a0 + 128;
a1 = b.a1 + 128;
lut1 = b.lut[0] | (b.lut[1] << 8) | (b.lut[2] << 16);
lut2 = b.lut[3] | (b.lut[4] << 8) | (b.lut[5] << 16);
} else {
Expand Down

0 comments on commit 8d81fd9

Please sign in to comment.