diff options
author | Sean Fox <dyntryx@gmail.com> | 2009-01-24 08:44:28 +0000 |
---|---|---|
committer | Sean Fox <dyntryx@gmail.com> | 2009-01-24 08:44:28 +0000 |
commit | dbf879a4defdf06743230cb8c88f38ee06b37837 (patch) | |
tree | fcb439d45c190df08fbc3da47d5681a0f20203d7 /examples/decode_bmp.c | |
parent | 45968abbfb5060f56cfcd19e9d82afc4797b9455 (diff) | |
download | libnsbmp-dbf879a4defdf06743230cb8c88f38ee06b37837.tar.gz libnsbmp-dbf879a4defdf06743230cb8c88f38ee06b37837.tar.bz2 |
Check for proper image decoding /prior/ to outputting anything.
svn path=/trunk/libnsbmp/; revision=6220
Diffstat (limited to 'examples/decode_bmp.c')
-rw-r--r-- | examples/decode_bmp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/decode_bmp.c b/examples/decode_bmp.c index 8675b34..92efd34 100644 --- a/examples/decode_bmp.c +++ b/examples/decode_bmp.c @@ -62,12 +62,6 @@ int main(int argc, char *argv[]) exit(1); } - printf("P3\n"); - printf("# %s\n", argv[1]); - printf("# width %u \n", bmp.width); - printf("# height %u \n", bmp.height); - printf("%u %u 256\n", bmp.width, bmp.height); - /* decode the image */ code = bmp_decode(&bmp); /* code = bmp_decode_trans(&bmp, TRANSPARENT_COLOR); */ @@ -75,6 +69,13 @@ int main(int argc, char *argv[]) warning("bmp_decode", code); exit(1); } + + printf("P3\n"); + printf("# %s\n", argv[1]); + printf("# width %u \n", bmp.width); + printf("# height %u \n", bmp.height); + printf("%u %u 256\n", bmp.width, bmp.height); + { uint16_t row, col; uint8_t *image; |