diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/decode_bmp.c | 7 | ||||
-rw-r--r-- | examples/decode_ico.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/examples/decode_bmp.c b/examples/decode_bmp.c index 43b0970..6834318 100644 --- a/examples/decode_bmp.c +++ b/examples/decode_bmp.c @@ -69,8 +69,11 @@ int main(int argc, char *argv[]) /* code = bmp_decode_trans(&bmp, TRANSPARENT_COLOR); */ if (code != BMP_OK) { warning("bmp_decode", code); - res = 1; - goto cleanup; + /* allow partially decoded images */ + if (code != BMP_INSUFFICIENT_DATA) { + res = 1; + goto cleanup; + } } printf("P3\n"); diff --git a/examples/decode_ico.c b/examples/decode_ico.c index 571c566..7d3ea4f 100644 --- a/examples/decode_ico.c +++ b/examples/decode_ico.c @@ -80,8 +80,11 @@ int main(int argc, char *argv[]) /* code = bmp_decode_trans(bmp, TRANSPARENT_COLOR); */ if (code != BMP_OK) { warning("bmp_decode", code); - res = 1; - goto cleanup; + /* allow partially decoded images */ + if (code != BMP_INSUFFICIENT_DATA) { + res = 1; + goto cleanup; + } } printf("P3\n"); |