diff options
author | Sean Fox <dyntryx@gmail.com> | 2009-01-24 19:29:40 +0000 |
---|---|---|
committer | Sean Fox <dyntryx@gmail.com> | 2009-01-24 19:29:40 +0000 |
commit | 3a18e3f0cdebb54504d083419377529d1465cf64 (patch) | |
tree | dc59e6120a6dbd61f5c14ba016e498033260c4a1 | |
parent | 2d03a9a948c50f35e57030b9c201a3752bfe5c81 (diff) | |
download | libnsbmp-3a18e3f0cdebb54504d083419377529d1465cf64.tar.gz libnsbmp-3a18e3f0cdebb54504d083419377529d1465cf64.tar.bz2 |
Examples now allow partially decoded images. A warning is given for BMP_INSUFFICIENT_DATA, but we still pass the bitmap data to display.
svn path=/trunk/libnsbmp/; revision=6252
-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"); |