Author: dynis
Date: Sat Jan 24 02:44:28 2009
New Revision: 6220

URL: http://source.netsurf-browser.org?rev=6220&view=rev
Log:
Check for proper image decoding /prior/ to outputting anything.

Modified:
    trunk/libnsbmp/examples/decode_bmp.c
    trunk/libnsbmp/examples/decode_ico.c

Modified: trunk/libnsbmp/examples/decode_bmp.c
URL: 
http://source.netsurf-browser.org/trunk/libnsbmp/examples/decode_bmp.c?rev=6220&r1=6219&r2=6220&view=diff
==============================================================================
--- trunk/libnsbmp/examples/decode_bmp.c (original)
+++ trunk/libnsbmp/examples/decode_bmp.c Sat Jan 24 02:44:28 2009
@@ -62,12 +62,6 @@
                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 @@
                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;

Modified: trunk/libnsbmp/examples/decode_ico.c
URL: 
http://source.netsurf-browser.org/trunk/libnsbmp/examples/decode_ico.c?rev=6220&r1=6219&r2=6220&view=diff
==============================================================================
--- trunk/libnsbmp/examples/decode_ico.c (original)
+++ trunk/libnsbmp/examples/decode_ico.c Sat Jan 24 02:44:28 2009
@@ -74,18 +74,19 @@
        bmp = ico_find(&ico, width, height);
        assert(bmp);
 
+       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);
 
-       code = bmp_decode(bmp);
-       /* code = bmp_decode_trans(bmp, TRANSPARENT_COLOR); */
-       if (code != BMP_OK) {
-               warning("bmp_decode", code);
-               exit(1);
-       }
        {
                uint16_t row, col;
                uint8_t *image;


_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to