diff options
author | fredb <fredb@pkgsrc.org> | 2001-08-05 23:43:12 +0000 |
---|---|---|
committer | fredb <fredb@pkgsrc.org> | 2001-08-05 23:43:12 +0000 |
commit | 418ee2d96a33ac4d0ea6a8c576e743a8d0f58451 (patch) | |
tree | 7de3237b9802272d3b27efefbd209ef55de7b92e /www | |
parent | 787f4880da5b4e7cb461c9e24409b9c32fbacfbd (diff) | |
download | pkgsrc-418ee2d96a33ac4d0ea6a8c576e743a8d0f58451.tar.gz |
Update PNG handling to work with png-1.0.11 and newer.
Diffstat (limited to 'www')
-rw-r--r-- | www/Mosaic/distinfo | 4 | ||||
-rw-r--r-- | www/Mosaic/patches/patch-ai | 122 |
2 files changed, 104 insertions, 22 deletions
diff --git a/www/Mosaic/distinfo b/www/Mosaic/distinfo index 01cda47925e..0be7e725626 100644 --- a/www/Mosaic/distinfo +++ b/www/Mosaic/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.3 2001/08/05 17:02:24 fredb Exp $ +$NetBSD: distinfo,v 1.4 2001/08/05 23:43:12 fredb Exp $ SHA1 (Mosaic-src-2.7b5.tar.gz) = 69705268cf8139ac51f394747e681c1bd8296fee Size (Mosaic-src-2.7b5.tar.gz) = 980929 bytes @@ -10,7 +10,7 @@ SHA1 (patch-ae) = 91122a34dbfe9d25b4c9ac0d16405b5801cefdff SHA1 (patch-af) = 6f28e5779ab21c4beddfb8f36daa8225ab59e83e SHA1 (patch-ag) = b178d56ff81f3a65a565d04f0999defffb61f773 SHA1 (patch-ah) = ef43ff9b0d72d7ffc6f11a759c4d6dfb3dcc1d67 -SHA1 (patch-ai) = e731be56b7784b0eddf5b6e987a95c598b076520 +SHA1 (patch-ai) = 61b2fc682763041e41f1401b87e3511fde93d5dc SHA1 (patch-aj) = 5a5c4afe02ed464873f05d5010259652e44ef11d SHA1 (patch-ak) = d7ddc0e984fb8fdd3272f052d35910f4bb4e276a SHA1 (patch-al) = 6cf33d9bad1001f14e62f8a6dba114ee46384652 diff --git a/www/Mosaic/patches/patch-ai b/www/Mosaic/patches/patch-ai index dd0c57be14b..d28c7f0d08b 100644 --- a/www/Mosaic/patches/patch-ai +++ b/www/Mosaic/patches/patch-ai @@ -1,21 +1,103 @@ -$NetBSD: patch-ai,v 1.2 1998/08/07 11:14:19 agc Exp $ +$NetBSD: patch-ai,v 1.3 2001/08/05 23:43:12 fredb Exp $ -*** src/readPNG.c.bak Sun Jun 30 16:30:00 1996 ---- src/readPNG.c Sat Aug 3 14:22:45 1996 -*************** -*** 159,165 **** - } - - /* SWP -- Hopefully to fix cores on bad PNG files */ -! png_set_message_fn(png_ptr,png_get_msg_ptr(png_ptr),NULL,NULL); - - /* initialize the structures */ - png_info_init(info_ptr); ---- 159,165 ---- - } - - /* SWP -- Hopefully to fix cores on bad PNG files */ -! png_set_error_fn(png_ptr,png_get_error_ptr(png_ptr),NULL,NULL); - - /* initialize the structures */ - png_info_init(info_ptr); +--- src/readPNG.c.orig Sun Jun 30 07:30:00 1996 ++++ src/readPNG.c +@@ -91,8 +91,8 @@ + unsigned char *p; + png_byte *q; + +- png_struct *png_ptr; +- png_info *info_ptr; ++ png_struct *png_ptr = NULL; ++ png_info *info_ptr = NULL; + + double screen_gamma; + +@@ -125,19 +125,20 @@ + decoding it */ + rewind(infile); + +- /* allocate the structures */ +- png_ptr = (png_struct *)malloc(sizeof(png_struct)); ++ /* allocate and initialize the structures */ ++ png_ptr = (png_struct *)png_create_read_struct(PNG_LIBPNG_VER_STRING, ++ NULL, NULL, NULL); + if(!png_ptr) + return 0; + +- info_ptr = (png_info *)malloc(sizeof(png_info)); ++ info_ptr = (png_info *)png_create_info_struct(png_ptr); + if(!info_ptr) { +- free(png_ptr); ++ png_destroy_read_struct(&png_ptr, NULL, NULL); + return 0; + } + + /* Establish the setjmp return context for png_error to use. */ +- if (setjmp(png_ptr->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png_ptr))) { + + #ifndef DISABLE_TRACE + if (srcTrace) { +@@ -145,26 +146,19 @@ + } + #endif + +- png_read_destroy(png_ptr, info_ptr, (png_info *)0); +- + if(png_pixels != NULL) + free((char *)png_pixels); + if(row_pointers != NULL) + free((png_byte **)row_pointers); +- +- free((char *)png_ptr); +- free((char *)info_ptr); + ++ png_destroy_read_struct(&png_ptr, &info_ptr, NULL); ++ + return 0; + } + + /* SWP -- Hopefully to fix cores on bad PNG files */ +- png_set_message_fn(png_ptr,png_get_msg_ptr(png_ptr),NULL,NULL); ++ png_set_error_fn(png_ptr,png_get_error_ptr(png_ptr),NULL,NULL); + +- /* initialize the structures */ +- png_info_init(info_ptr); +- png_read_init(png_ptr); +- + /* set up the input control */ + png_init_io(png_ptr, infile); + +@@ -316,13 +310,14 @@ + png_read_image(). */ + png_pixels = (png_byte *)malloc(info_ptr->rowbytes * + (*height) * sizeof(png_byte)); +- + + row_pointers = (png_byte **) malloc((*height) * sizeof(png_byte *)); + for (i=0; i < *height; i++) + row_pointers[i]=png_pixels+(info_ptr->rowbytes*i); + +- ++ png_set_rows(png_ptr, info_ptr, row_pointers); ++ ++ + /* FINALLY - read the darn thing. */ + png_read_image(png_ptr, row_pointers); + +@@ -409,13 +404,8 @@ + free((png_byte **)row_pointers); + + /* clean up after the read, and free any memory allocated */ +- png_read_destroy(png_ptr, info_ptr, (png_info *)0); +- ++ png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + +- /* free the structures */ +- free((char *)png_ptr); +- free((char *)info_ptr); +- + return pixmap; + } + |