Fixed stupid endianness bug.
Incorrect endianness hilariously doesn't manifest _if_ the original image was upconverted from 8-bit to 16-bit.
This commit is contained in:
parent
608cbec1f5
commit
6645ea5915
@ -5195,7 +5195,7 @@ static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int
|
|||||||
// Read the data.
|
// Read the data.
|
||||||
if (bitdepth == 16) {
|
if (bitdepth == 16) {
|
||||||
for (i = 0; i < pixelCount; i++, p += 4)
|
for (i = 0; i < pixelCount; i++, p += 4)
|
||||||
*p = stbi__get16le(s) * 255 / 65535;
|
*p = stbi__get16be(s) * 255 / 65535;
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < pixelCount; i++, p += 4)
|
for (i = 0; i < pixelCount; i++, p += 4)
|
||||||
*p = stbi__get8(s);
|
*p = stbi__get8(s);
|
||||||
|
Loading…
Reference in New Issue
Block a user