Skip to content

Commit

Permalink
qoi: Added support for image of channels 3 (#4384)
Browse files Browse the repository at this point in the history
  • Loading branch information
R-YaTian authored Oct 15, 2024
1 parent 99ff770 commit 8d267aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rtextures.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,10 @@ Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, i
if (fileData != NULL)
{
qoi_desc desc = { 0 };
image.data = qoi_decode(fileData, dataSize, &desc, 4);
image.data = qoi_decode(fileData, dataSize, &desc, (int) fileData[12]);
image.width = desc.width;
image.height = desc.height;
image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
image.format = desc.channels == 4 ? PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 : PIXELFORMAT_UNCOMPRESSED_R8G8B8;
image.mipmaps = 1;
}
}
Expand Down

0 comments on commit 8d267aa

Please sign in to comment.