diff options
author | wiz <wiz@pkgsrc.org> | 2001-08-03 09:43:18 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2001-08-03 09:43:18 +0000 |
commit | b0ecb8d9191b2732248a47f2a374e60a99384cc4 (patch) | |
tree | 6c29fe00fc9ae4ed39c7e357c4926a9fd54e0e4c /graphics/xart | |
parent | e1d55fb7ab8538520fc41701e5a7a74e860bbf2b (diff) | |
download | pkgsrc-b0ecb8d9191b2732248a47f2a374e60a99384cc4.tar.gz |
Adapt png handling to latest spec. Requested in pkg/13597.
Diffstat (limited to 'graphics/xart')
-rw-r--r-- | graphics/xart/Makefile | 6 | ||||
-rw-r--r-- | graphics/xart/distinfo | 4 | ||||
-rw-r--r-- | graphics/xart/patches/patch-af | 52 | ||||
-rw-r--r-- | graphics/xart/patches/patch-ag | 63 |
4 files changed, 121 insertions, 4 deletions
diff --git a/graphics/xart/Makefile b/graphics/xart/Makefile index 4d92ddd7fc9..0964050307e 100644 --- a/graphics/xart/Makefile +++ b/graphics/xart/Makefile @@ -1,14 +1,14 @@ -# $NetBSD: Makefile,v 1.20 2001/06/25 23:58:32 zuntum Exp $ +# $NetBSD: Makefile,v 1.21 2001/08/03 09:43:18 wiz Exp $ # DISTNAME= xart19980415 PKGNAME= xart-19980415 CATEGORIES= graphics x11 -MASTER_SITES= http://www.cqi.com/~humbubba/linux/ +MASTER_SITES= http://linux01.gwdg.de/~rhohen/linux/ EXTRACT_SUFX= .tgz MAINTAINER= packages@netbsd.org -HOMEPAGE= http://www.cqi.com/~humbubba/linux.html +HOMEPAGE= http://linux01.gwdg.de/~rhohen/linux.html COMMENT= Paint program (enhanced xpaint) USE_BUILDLINK_ONLY=YES diff --git a/graphics/xart/distinfo b/graphics/xart/distinfo index 28ab9d8218c..62030fb3073 100644 --- a/graphics/xart/distinfo +++ b/graphics/xart/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.2 2001/04/21 09:54:28 wiz Exp $ +$NetBSD: distinfo,v 1.3 2001/08/03 09:43:18 wiz Exp $ SHA1 (xart19980415.tgz) = d4445392e33a5dcf5ae951babac82394e7cdd65c Size (xart19980415.tgz) = 343909 bytes @@ -7,3 +7,5 @@ SHA1 (patch-ab) = b0f00e29560ce786e37a8ba62fef82dae80c4ee9 SHA1 (patch-ac) = 28d32baa735b55a579a0e12a106621b95f60b2ba SHA1 (patch-ad) = 08059ca068d156be0e31283180c5deaebb99f7bd SHA1 (patch-ae) = 20d847bc9faa0e13bf161041d7fd7a44af73bad1 +SHA1 (patch-af) = 6bf891c7532f257a18d3e2917353a36ca519221f +SHA1 (patch-ag) = c764ddf68af02eda1475778e6c1774d751e68a92 diff --git a/graphics/xart/patches/patch-af b/graphics/xart/patches/patch-af new file mode 100644 index 00000000000..750a72cd88f --- /dev/null +++ b/graphics/xart/patches/patch-af @@ -0,0 +1,52 @@ +$NetBSD: patch-af,v 1.1 2001/08/03 09:43:18 wiz Exp $ + +--- rw/readPNG.c.orig Thu Aug 29 07:24:48 1996 ++++ rw/readPNG.c +@@ -46,8 +46,8 @@ + ReadPNG(char *file) + { + FILE *fp; +- png_structp png_ptr; +- png_infop info_ptr; ++ png_structp png_ptr = NULL; ++ png_infop info_ptr = NULL; + int i, hasAlpha=FALSE; + int width, height, level, bit_depth, npasses; + Image *image = NULL; +@@ -59,14 +59,15 @@ + return NULL; + } + +- png_ptr = (png_structp)malloc(sizeof(png_struct)); ++ png_ptr = (png_structp)png_create_read_struct(PNG_LIBPNG_VER_STRING, ++ NULL, NULL, NULL); + if (!png_ptr) { + RWSetMsg("Error allocating PNG png_ptr memory"); + fclose(fp); + return NULL; + } + +- info_ptr = (png_infop)malloc(sizeof(png_info)); ++ info_ptr = (png_infop)png_create_info_struct(png_ptr); + if (!info_ptr) { + RWSetMsg("Error allocating PNG info_ptr memory"); + free(png_ptr); +@@ -74,17 +75,13 @@ + return NULL; + } + +- if (setjmp(png_ptr->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png_ptr))) { + RWSetMsg("Error setting longjmp error handler"); + png_read_destroy(png_ptr, info_ptr, (png_info *)0); +- free(png_ptr); +- free(info_ptr); + fclose(fp); + return NULL; + } + +- png_info_init(info_ptr); +- png_read_init(png_ptr); + png_init_io(png_ptr, fp); + png_read_info(png_ptr, info_ptr); + diff --git a/graphics/xart/patches/patch-ag b/graphics/xart/patches/patch-ag new file mode 100644 index 00000000000..c62e0c04764 --- /dev/null +++ b/graphics/xart/patches/patch-ag @@ -0,0 +1,63 @@ +$NetBSD: patch-ag,v 1.1 2001/08/03 09:43:18 wiz Exp $ + +--- rw/writePNG.c.orig Thu Aug 29 07:24:57 1996 ++++ rw/writePNG.c +@@ -38,26 +38,23 @@ + if (!fp) + return 1; + +- png_ptr = (png_structp)malloc(sizeof (png_struct)); ++ png_ptr = (png_structp)png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, ++ NULL, NULL); + if (!png_ptr) + return 1; + +- info_ptr = (png_infop)malloc(sizeof (png_info)); ++ info_ptr = (png_infop)png_create_info_struct(png_ptr); + if (!info_ptr) { +- free(png_ptr); ++ png_destroy_write_struct(&png_ptr, NULL); + return 1; + } + +- if (setjmp(png_ptr->jmpbuf)) { +- png_write_destroy(png_ptr); +- free(info_ptr); +- free(png_ptr); ++ if (setjmp(png_jmpbuf(png_ptr))) { ++ png_destroy_write_struct(&png_ptr, &info_ptr); + fclose(fp); + return 1; + } + +- png_info_init(info_ptr); +- png_write_init(png_ptr); + png_init_io(png_ptr, fp); + + info_ptr->width = image->width; +@@ -200,9 +197,7 @@ + /* alpha channel version */ + fprintf(stderr, "WritePNG: sorry, can't write alpha images yet\n"); + fflush(stderr); +- png_write_destroy(png_ptr); +- free(info_ptr); +- free(png_ptr); ++ png_destroy_write_struct(&png_ptr, &info_ptr); + fclose(fp); + return 1; + } else { +@@ -222,13 +217,11 @@ + } + + png_write_end(png_ptr, NULL); +- png_write_destroy(png_ptr); ++ png_destroy_write_struct(&png_ptr, &info_ptr); + + if (software) + free(software); /* we LOVE free software!! */ + +- free(info_ptr); +- free(png_ptr); /* necessary?? */ + fclose(fp); + + return 0; |