summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSean Fox <dyntryx@gmail.com>2009-01-24 19:29:40 +0000
committerSean Fox <dyntryx@gmail.com>2009-01-24 19:29:40 +0000
commit3a18e3f0cdebb54504d083419377529d1465cf64 (patch)
treedc59e6120a6dbd61f5c14ba016e498033260c4a1 /examples
parent2d03a9a948c50f35e57030b9c201a3752bfe5c81 (diff)
downloadlibnsbmp-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
Diffstat (limited to 'examples')
-rw-r--r--examples/decode_bmp.c7
-rw-r--r--examples/decode_ico.c7
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");