Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions spng/spng.c
Original file line number Diff line number Diff line change
Expand Up @@ -3749,13 +3749,15 @@ int spng_decode_image(spng_ctx *ctx, void *out, size_t len, int fmt, int flags)

f.apply_trns = 0;
}
else if(fmt == SPNG_FMT_GA8 && ihdr->color_type == SPNG_COLOR_TYPE_GRAYSCALE && ihdr->bit_depth <= 8)
else if(fmt == SPNG_FMT_GA8 && (ihdr->color_type == SPNG_COLOR_TYPE_GRAYSCALE ||
ihdr->color_type == SPNG_COLOR_TYPE_GRAYSCALE_ALPHA) && ihdr->bit_depth <= 8)
{
if(ihdr->color_type == SPNG_COLOR_TYPE_GRAYSCALE_ALPHA &&
ihdr->bit_depth == depth_target) f.same_layout = 1;
else if(ihdr->bit_depth <= 8) f.unpack = 1;
}
else if(fmt == SPNG_FMT_GA16 && ihdr->color_type == SPNG_COLOR_TYPE_GRAYSCALE && ihdr->bit_depth == 16)
else if(fmt == SPNG_FMT_GA16 && (ihdr->color_type == SPNG_COLOR_TYPE_GRAYSCALE ||
ihdr->color_type == SPNG_COLOR_TYPE_GRAYSCALE_ALPHA) && ihdr->bit_depth == 16)
{
if(ihdr->color_type == SPNG_COLOR_TYPE_GRAYSCALE_ALPHA &&
ihdr->bit_depth == depth_target) f.same_layout = 1;
Expand Down