From dbf879a4defdf06743230cb8c88f38ee06b37837 Mon Sep 17 00:00:00 2001 From: Sean Fox Date: Sat, 24 Jan 2009 08:44:28 +0000 Subject: Check for proper image decoding /prior/ to outputting anything. svn path=/trunk/libnsbmp/; revision=6220 --- examples/decode_ico.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'examples/decode_ico.c') diff --git a/examples/decode_ico.c b/examples/decode_ico.c index c940606..c917c99 100644 --- a/examples/decode_ico.c +++ b/examples/decode_ico.c @@ -74,18 +74,19 @@ int main(int argc, char *argv[]) bmp = ico_find(&ico, width, height); assert(bmp); - 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); - code = bmp_decode(bmp); /* code = bmp_decode_trans(bmp, TRANSPARENT_COLOR); */ if (code != BMP_OK) { 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; -- cgit v1.2.3