diff options
author | tron <tron> | 2011-04-06 22:17:40 +0000 |
---|---|---|
committer | tron <tron> | 2011-04-06 22:17:40 +0000 |
commit | a556fa12cb190abd70c155f0dc5c296a7c3b723a (patch) | |
tree | 836aa78bf638bfa581e3aef1a693eefbc116360b /www | |
parent | 84a596b3c717bfa5f80008f616b62a2e6d01d53c (diff) | |
download | pkgsrc-a556fa12cb190abd70c155f0dc5c296a7c3b723a.tar.gz |
Pullup ticket #3400 - requested by wiz
audio/gqmpeg-devel: build fix
devel/teem: build fix
games/ufoai: build fix
graphics/tuxpaint: build fix
lang/kaffe: build fix
sysutils/xnc: build fix
wm/afterstep: build fix
www/chimera: build fix
www/mMosaic: build fix
x11/xcursorgen: build fix
Revisions pulled up:
- audio/gqmpeg-devel/distinfo 1.5
- audio/gqmpeg-devel/patches/patch-src_ui__pixbuf__save.c 1.1
- devel/teem/distinfo 1.6
- devel/teem/patches/patch-ad 1.2
- games/ufoai/distinfo 1.5
- games/ufoai/patches/patch-ab 1.3
- graphics/tuxpaint/distinfo 1.21
- graphics/tuxpaint/patches/patch-ab 1.5
- lang/kaffe/distinfo 1.30
- lang/kaffe/patches/patch-libraries_clib_awt_X_imgpng.c 1.1
- sysutils/xnc/distinfo 1.8
- sysutils/xnc/patches/patch-src_lib_image2_sdl__image_IMG__png.c 1.1
- wm/afterstep/distinfo 1.13
- wm/afterstep/patches/patch-libAfterImage_export.c 1.1
- wm/afterstep/patches/patch-libAfterImage_import.c 1.1
- www/chimera/distinfo 1.9
- www/chimera/patches/patch-ad 1.5
- www/mMosaic/distinfo 1.11
- www/mMosaic/patches/patch-ai 1.2
- www/mMosaic/patches/patch-src_MIME.c 1.1
- x11/xcursorgen/distinfo 1.3
- x11/xcursorgen/patches/patch-xcursorgen.c 1.1
---
Module Name: pkgsrc
Committed By: wiz
Date: Tue Apr 5 08:09:47 UTC 2011
Modified Files:
pkgsrc/audio/gqmpeg-devel: distinfo
Added Files:
pkgsrc/audio/gqmpeg-devel/patches: patch-src_ui__pixbuf__save.c
Log Message:
Fix build with png-1.5.
---
Module Name: pkgsrc
Committed By: wiz
Date: Tue Apr 5 11:04:40 UTC 2011
Modified Files:
pkgsrc/graphics/tuxpaint: distinfo
pkgsrc/graphics/tuxpaint/patches: patch-ab
Log Message:
Fix build with png-1.5.
---
Module Name: pkgsrc
Committed By: wiz
Date: Tue Apr 5 11:07:00 UTC 2011
Modified Files:
pkgsrc/x11/xcursorgen: distinfo
Added Files:
pkgsrc/x11/xcursorgen/patches: patch-xcursorgen.c
Log Message:
Fix build with png-1.5.
---
Module Name: pkgsrc
Committed By: wiz
Date: Tue Apr 5 11:27:29 UTC 2011
Modified Files:
pkgsrc/devel/teem: distinfo
pkgsrc/devel/teem/patches: patch-ad
Log Message:
Fix build with png-1.5.
---
Module Name: pkgsrc
Committed By: wiz
Date: Tue Apr 5 11:32:46 UTC 2011
Modified Files:
pkgsrc/games/ufoai: distinfo
pkgsrc/games/ufoai/patches: patch-ab
Log Message:
Fix build with png-1.5.
---
Module Name: pkgsrc
Committed By: wiz
Date: Tue Apr 5 11:49:51 UTC 2011
Modified Files:
pkgsrc/lang/kaffe: distinfo
Added Files:
pkgsrc/lang/kaffe/patches: patch-libraries_clib_awt_X_imgpng.c
Log Message:
Fix build with png-1.5.
---
Module Name: pkgsrc
Committed By: wiz
Date: Tue Apr 5 11:56:30 UTC 2011
Modified Files:
pkgsrc/sysutils/xnc: distinfo
Added Files:
pkgsrc/sysutils/xnc/patches: patch-src_lib_image2_sdl__image_IMG__png.c
Log Message:
Fix build with png-1.5.
---
Module Name: pkgsrc
Committed By: wiz
Date: Tue Apr 5 12:02:00 UTC 2011
Modified Files:
pkgsrc/wm/afterstep: distinfo
Added Files:
pkgsrc/wm/afterstep/patches: patch-libAfterImage_export.c
patch-libAfterImage_import.c
Log Message:
Fix build with png-1.5.
---
Module Name: pkgsrc
Committed By: wiz
Date: Tue Apr 5 12:16:39 UTC 2011
Modified Files:
pkgsrc/www/chimera: distinfo
pkgsrc/www/chimera/patches: patch-ad
Log Message:
Fix build with png-1.5.
---
Module Name: pkgsrc
Committed By: wiz
Date: Tue Apr 5 12:27:06 UTC 2011
Modified Files:
pkgsrc/www/mMosaic: distinfo
pkgsrc/www/mMosaic/patches: patch-ai
Added Files:
pkgsrc/www/mMosaic/patches: patch-src_MIME.c
Log Message:
Fix build with png-1.5 and avoid conflict with getline() on NetBSD.
Diffstat (limited to 'www')
-rw-r--r-- | www/chimera/distinfo | 4 | ||||
-rw-r--r-- | www/chimera/patches/patch-ad | 187 | ||||
-rw-r--r-- | www/mMosaic/distinfo | 5 | ||||
-rw-r--r-- | www/mMosaic/patches/patch-ai | 184 | ||||
-rw-r--r-- | www/mMosaic/patches/patch-src_MIME.c | 24 |
5 files changed, 383 insertions, 21 deletions
diff --git a/www/chimera/distinfo b/www/chimera/distinfo index 513e02d0278..68e0c7c58ac 100644 --- a/www/chimera/distinfo +++ b/www/chimera/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.8 2011/01/13 13:52:54 wiz Exp $ +$NetBSD: distinfo,v 1.8.2.1 2011/04/06 22:17:43 tron Exp $ SHA1 (chimera-2.0a19.tar.gz) = c69b70b11cf12837e260eaa20e548bf9eb9ce309 RMD160 (chimera-2.0a19.tar.gz) = d3f4d2ff3328c3bf5020490ed851b281e0492fe2 @@ -6,6 +6,6 @@ Size (chimera-2.0a19.tar.gz) = 248431 bytes SHA1 (patch-aa) = a49455c9e2ce2a9bd3b276ae870739ece6249373 SHA1 (patch-ab) = 1fc2f5f97f46403359a00e42cc25f4cbf9bc5331 SHA1 (patch-ac) = 5f18afd9a1452bfba010fe3eb4e773f5395789c6 -SHA1 (patch-ad) = fcfc16397954269a8493017ca06707f043a0cf06 +SHA1 (patch-ad) = 0f7e49c81761e4f9ace49163f550eef8723df933 SHA1 (patch-ae) = 8b8e1bc50791b635e5e87860302d0e758d159ed9 SHA1 (patch-af) = 76256ccb4b5183a8d30a46a89a0cd75b113122fc diff --git a/www/chimera/patches/patch-ad b/www/chimera/patches/patch-ad index f9077ca4c62..dd9f62258d9 100644 --- a/www/chimera/patches/patch-ad +++ b/www/chimera/patches/patch-ad @@ -1,27 +1,180 @@ -$NetBSD: patch-ad,v 1.4 2010/06/13 22:45:32 wiz Exp $ +$NetBSD: patch-ad,v 1.4.8.1 2011/04/06 22:17:43 tron Exp $ + +Fix build with png-1.5. --- image/png.c.orig 1999-03-29 02:23:46.000000000 +0000 +++ image/png.c -@@ -126,7 +126,7 @@ lf_info_callback(png_struct *state, png_ +@@ -60,33 +60,33 @@ lf_info_callback(png_struct *state, png_ + int orig_depth = 0; + pngState *png = (pngState *) png_get_progressive_ptr(state); + +- if (info->bit_depth < 8 && (PNG_COLOR_TYPE_RGB == info->color_type || +- PNG_COLOR_TYPE_RGB_ALPHA == info->color_type)) ++ if (png_get_bit_depth(state, info) < 8 && (PNG_COLOR_TYPE_RGB == png_get_color_type(state, info) || ++ PNG_COLOR_TYPE_RGB_ALPHA == png_get_color_type(state, info))) + png_set_expand(state); + + /* I wish the frame's background colour was available here */ +- if (info->color_type & PNG_COLOR_MASK_ALPHA) { ++ if (png_get_color_type(state, info) & PNG_COLOR_MASK_ALPHA) { + png_color_16 bg; + int gflag = PNG_BACKGROUND_GAMMA_SCREEN; + double gval = 1.0; + int expand = 0; + + bg.red = bg.green = bg.blue = bg.gray = 0; +- if (PNG_COLOR_TYPE_PALETTE == info->color_type) ++ if (PNG_COLOR_TYPE_PALETTE == png_get_color_type(state, info)) + png_set_expand(state); + + png_set_background(state, &bg, gflag, expand, gval); + } + +- if (info->bit_depth < 8 && (info->bit_depth > 1 || +- PNG_COLOR_TYPE_GRAY != info->color_type)) { +- if (PNG_COLOR_TYPE_GRAY == info->color_type) +- orig_depth = info->bit_depth; ++ if (png_get_bit_depth(state, info) < 8 && (png_get_bit_depth(state, info) > 1 || ++ PNG_COLOR_TYPE_GRAY != png_get_color_type(state, info))) { ++ if (PNG_COLOR_TYPE_GRAY == png_get_color_type(state, info)) ++ orig_depth = png_get_bit_depth(state, info); + png_set_packing(state); + } + + /* tell libpng to strip 16 bit depth files down to 8 bits */ +- if (info->bit_depth > 8) ++ if (png_get_bit_depth(state, info) > 8) + png_set_strip_16(state); + + png_set_interlace_handling(state); +@@ -95,18 +95,21 @@ lf_info_callback(png_struct *state, png_ + png_read_update_info(state, info); + + /* allocate the memory to hold the image using the fields of png_info. */ +- if (PNG_COLOR_TYPE_GRAY == info->color_type && 1 == info->bit_depth) { +- png->image = newBitImage(info->width, info->height); ++ if (PNG_COLOR_TYPE_GRAY == png_get_color_type(state, info) && 1 == png_get_bit_depth(state, info)) { ++ png->image = newBitImage(png_get_image_width(state, info), png_get_image_height(state, info)); + if (!png->image) { + png->done = image_error; + return; + } + + png_set_invert_mono(state); +- } else if (PNG_COLOR_TYPE_PALETTE == info->color_type) { ++ } else if (PNG_COLOR_TYPE_PALETTE == png_get_color_type(state, info)) { + int i; ++ png_colorp palette; ++ int num_palette; + +- png->image = newRGBImage(info->width, info->height, info->bit_depth); ++ png_get_PLTE(state, info, &palette, &num_palette); ++ png->image = newRGBImage(png_get_image_width(state, info), png_get_image_height(state, info), png_get_bit_depth(state, info)); + if (!png->image) { + png->done = image_error; + return; +@@ -115,28 +118,32 @@ lf_info_callback(png_struct *state, png_ + png->image->rgb.red = png->cmap[0]; + png->image->rgb.green = png->cmap[1]; + png->image->rgb.blue = png->cmap[2]; +- for (i = 0; i < info->num_palette; ++i) { +- png->image->rgb.red[i] = info->palette[i].red << 8; +- png->image->rgb.green[i] = info->palette[i].green << 8; +- png->image->rgb.blue[i] = info->palette[i].blue << 8; ++ for (i = 0; i < num_palette; ++i) { ++ png->image->rgb.red[i] = palette[i].red << 8; ++ png->image->rgb.green[i] = palette[i].green << 8; ++ png->image->rgb.blue[i] = palette[i].blue << 8; + } +- png->image->rgb.used = info->num_palette; +- if (info->valid & PNG_INFO_tRNS) { ++ png->image->rgb.used = num_palette; ++ if (png_get_valid(state, info, PNG_INFO_tRNS)) { + int val, i; ++ png_bytep trans_alpha; ++ int num_trans; ++ png_color_16p trans_color; ++ png_get_tRNS(state, info, &trans_alpha, &num_trans, &trans_color); val = 0; - for (i = 0; i < info->num_trans; ++i) { +- for (i = 0; i < info->num_trans; ++i) { - if (info->trans[i] < info->trans[val]) -+ if (info->trans_alpha[i] < info->trans_alpha[val]) ++ for (i = 0; i < num_trans; ++i) { ++ if (trans_alpha[i] < trans_alpha[val]) val = i; } png->image->transparent = val; -@@ -154,7 +154,7 @@ lf_info_callback(png_struct *state, png_ + } +- } else if (PNG_COLOR_TYPE_GRAY == info->color_type) { ++ } else if (PNG_COLOR_TYPE_GRAY == png_get_color_type(state, info)) { + int i; +- int depth = orig_depth ? orig_depth : info->bit_depth; ++ int depth = orig_depth ? orig_depth : png_get_bit_depth(state, info); + int maxval = (1 << depth) - 1; + +- png->image = newRGBImage(info->width, info->height, depth); ++ png->image = newRGBImage(png_get_image_width(state, info), png_get_image_height(state, info), depth); + if (!png->image) { + png->done = image_error; + return; +@@ -153,10 +160,16 @@ lf_info_callback(png_struct *state, png_ + } png->image->rgb.used = maxval + 1; - if (info->valid & PNG_INFO_tRNS) +- if (info->valid & PNG_INFO_tRNS) - png->image->transparent = info->trans_values.gray; -+ png->image->transparent = info->trans_color.gray; ++ if (png_get_valid(state, info, PNG_INFO_tRNS)) { ++ png_bytep trans_alpha; ++ int num_trans; ++ png_color_16p trans_color; ++ ++ png_get_tRNS(state, info, &trans_alpha, &num_trans, &trans_color); ++ png->image->transparent = trans_color->gray; ++ } } else { - png->image = newTrueImage(info->width, info->height); +- png->image = newTrueImage(info->width, info->height); ++ png->image = newTrueImage(png_get_image_width(state, info), png_get_image_height(state, info)); if (!png->image) { -@@ -222,17 +222,11 @@ pngDestroy(void *pointer) - if (setjmp(png->state->jmpbuf)) + png->done = image_error; + return; +@@ -164,10 +177,13 @@ lf_info_callback(png_struct *state, png_ + + } + +- if (info->valid & PNG_INFO_gAMA && png->image->type != IBITMAP) +- png->image->gamma = 1.0 / info->gamma; ++ if (png_get_valid(state, info, PNG_INFO_gAMA) && png->image->type != IBITMAP) { ++ double gamma; ++ png_get_gAMA(state, info, &gamma); ++ png->image->gamma = 1.0 / gamma; ++ } + +- assert((png->image->width * png->image->pixlen + 7) / 8 == info->rowbytes); ++ assert((png->image->width * png->image->pixlen + 7) / 8 == png_get_rowbytes(state, info)); + } + + +@@ -192,12 +208,12 @@ lf_row_callback(png_struct *state, png_b + /* I can't say I'm too fond of this endian business. */ + #ifdef CHIMERA_LITTLE_ENDIAN + if (IBITMAP == png->image->type) +- lc_reverse_byte(old_row, png->info->rowbytes); ++ lc_reverse_byte(old_row, png_get_rowbytes(png->state, png->info)); + #endif + (png->lineProc)(png->closure, row_num, row_num); + #ifdef CHIMERA_LITTLE_ENDIAN + if (IBITMAP == png->image->type) +- lc_reverse_byte(old_row,png->info->rowbytes); ++ lc_reverse_byte(old_row,png_get_rowbytes(png->state, png->info)); + #endif + } + } +@@ -219,20 +235,14 @@ pngDestroy(void *pointer) + if (!png) + return; + +- if (setjmp(png->state->jmpbuf)) ++ if (setjmp(png_jmpbuf(png->state))) return; - if (png->state) { @@ -40,7 +193,16 @@ $NetBSD: patch-ad,v 1.4 2010/06/13 22:45:32 wiz Exp $ if (png->image) { freeImage(png->image); png->image = 0; -@@ -275,28 +269,22 @@ pngInit(void (*lineProc)(void *, int, in +@@ -246,7 +256,7 @@ pngAddData(void *pointer, byte *data, in + { + pngState *png = (pngState *) pointer; + +- if (setjmp(png->state->jmpbuf)) ++ if (setjmp(png_jmpbuf(png->state))) + return image_error; + + if (len > png->lenSoFar) { +@@ -275,28 +285,22 @@ pngInit(void (*lineProc)(void *, int, in memset(png, 0, sizeof(pngState)); png->lineProc = lineProc; png->closure = closure; @@ -58,12 +220,13 @@ $NetBSD: patch-ad,v 1.4 2010/06/13 22:45:32 wiz Exp $ return; } - if (setjmp(png->state->jmpbuf)) { +- if (setjmp(png->state->jmpbuf)) { - png_read_destroy(png->state, png->info, (png_info *) 0); - free_mem(png->state); - free_mem(png->info); - png->state = 0; - png->info = 0; ++ if (setjmp(png_jmpbuf(png->state))) { + png_destroy_read_struct(&png->state, &png->info, (png_info **)NULL); return; } diff --git a/www/mMosaic/distinfo b/www/mMosaic/distinfo index ba233d81c81..b230aaf1f8e 100644 --- a/www/mMosaic/distinfo +++ b/www/mMosaic/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.10 2007/08/08 20:20:07 joerg Exp $ +$NetBSD: distinfo,v 1.10.34.1 2011/04/06 22:17:43 tron Exp $ SHA1 (mMosaic-3.7.2.tar.gz) = f26d4fd115a0fb7fc09947506b59e1a3790b6ac7 RMD160 (mMosaic-3.7.2.tar.gz) = 9c7f2e2f00beaef474e53e25a91aeb604584dd06 @@ -11,10 +11,11 @@ SHA1 (patch-ae) = 41eb6cccefb77f720bba0885993c453bc25dc14e SHA1 (patch-af) = 0cba2c49579f6631d7e7d4f1068c00c22401d879 SHA1 (patch-ag) = 51a1021eda3d92bc8bea7dacda510b24ee8ae7ef SHA1 (patch-ah) = db079473aee7b0ad4b674128d5debeb6e777640b -SHA1 (patch-ai) = 990bfbd0181fa93a53de7aaa9a98e5e954e72813 +SHA1 (patch-ai) = 48f4098b1ea36d7669fa620bb153c66a1516b1d4 SHA1 (patch-aj) = 7f4c86ec65d664dbeacd36ca0f3ae37f31fdd9cf SHA1 (patch-ak) = 2c698bbee79beb0b907c24361b501a71d319c839 SHA1 (patch-al) = 659a831be28c22835a4ba2fbb1f39b92d43bd5e7 SHA1 (patch-am) = c309f09e1e2ccf70c1ae3d1cc46d329af2c97209 SHA1 (patch-an) = 3e03f847457166662da82162144a417d316a6508 SHA1 (patch-ao) = afd25d932c5306c8dbee92715478235a76c3c69d +SHA1 (patch-src_MIME.c) = 02299b133fa3d2fe180ca6db49c9bc2b7c629aaa diff --git a/www/mMosaic/patches/patch-ai b/www/mMosaic/patches/patch-ai index 516e970e07d..534694d0b17 100644 --- a/www/mMosaic/patches/patch-ai +++ b/www/mMosaic/patches/patch-ai @@ -1,6 +1,8 @@ -$NetBSD: patch-ai,v 1.1 2006/04/19 19:21:28 wiz Exp $ +$NetBSD: patch-ai,v 1.1.44.1 2011/04/06 22:17:44 tron Exp $ ---- src/readPNG.c.orig 2000-12-08 19:00:45.000000000 +0100 +Fix build with png-1.5. + +--- src/readPNG.c.orig 2000-12-08 18:00:45.000000000 +0000 +++ src/readPNG.c @@ -35,8 +35,8 @@ unsigned char * ReadPNG(FILE *infile,int unsigned char *pixmap; @@ -13,7 +15,7 @@ $NetBSD: patch-ai,v 1.1 2006/04/19 19:21:28 wiz Exp $ double screen_gamma; png_byte *png_pixels=NULL, **row_pointers=NULL; int i, j; -@@ -60,14 +60,16 @@ unsigned char * ReadPNG(FILE *infile,int +@@ -60,40 +60,36 @@ unsigned char * ReadPNG(FILE *infile,int rewind(infile); /* allocate the structures */ @@ -38,7 +40,9 @@ $NetBSD: patch-ai,v 1.1 2006/04/19 19:21:28 wiz Exp $ } /* Establish the setjmp return context for png_error to use. */ -@@ -76,24 +78,18 @@ unsigned char * ReadPNG(FILE *infile,int +- if (setjmp(png_ptr->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png_ptr))) { + if (mMosaicSrcTrace) { fprintf(stderr, "\n!!!libpng read error!!!\n"); } @@ -64,7 +68,177 @@ $NetBSD: patch-ai,v 1.1 2006/04/19 19:21:28 wiz Exp $ /* set up the input control */ png_init_io(png_ptr, infile); -@@ -283,10 +279,7 @@ pixmap, since I don't do anything with i +@@ -102,19 +98,19 @@ unsigned char * ReadPNG(FILE *infile,int + + /* setup other stuff using the fields of png_info. */ + +- *width = (int)png_ptr->width; +- *height = (int)png_ptr->height; ++ *width = (int)png_get_image_width(png_ptr, info_ptr); ++ *height = (int)png_get_image_height(png_ptr, info_ptr); + + #ifdef DEBUG_PNG +- fprintf(stderr,"\n\nBEFORE\nheight = %d\n", (int)png_ptr->width); +- fprintf(stderr,"width = %d\n", (int)png_ptr->height); +- fprintf(stderr,"bit depth = %d\n", info_ptr->bit_depth); +- fprintf(stderr,"color type = %d\n", info_ptr->color_type); ++ fprintf(stderr,"\n\nBEFORE\nheight = %d\n", (int)png_get_image_width(png_ptr, info_ptr)); ++ fprintf(stderr,"width = %d\n", (int)png_get_image_height(png_ptr, info_ptr)); ++ fprintf(stderr,"bit depth = %d\n", png_get_bit_depth(png_ptr, info_ptr)); ++ fprintf(stderr,"color type = %d\n", png_get_color_type(png_ptr, info_ptr)); + fprintf(stderr,"compression type = %d\n", info_ptr->compression_type); + fprintf(stderr,"filter type = %d\n", info_ptr->filter_type); + fprintf(stderr,"interlace type = %d\n", info_ptr->interlace_type); + fprintf(stderr,"num colors = %d\n",info_ptr->num_palette); +- fprintf(stderr,"rowbytes = %d\n", info_ptr->rowbytes); ++ fprintf(stderr,"rowbytes = %d\n", png_get_rowbytes(png_ptr, info_ptr)); + #endif + #if 0 + /* This handles alpha and transparency by replacing it with +@@ -133,15 +129,15 @@ unsigned char * ReadPNG(FILE *infile,int + #endif + + /* strip pixels in 16-bit images down to 8 bits */ +- if (info_ptr->bit_depth == 16) ++ if (png_get_bit_depth(png_ptr, info_ptr) == 16) + png_set_strip_16(png_ptr); + + /* If it is a color image then check if it has a palette. If not + then dither the image to 256 colors, and make up a palette */ +- if (info_ptr->color_type==PNG_COLOR_TYPE_RGB || +- info_ptr->color_type==PNG_COLOR_TYPE_RGB_ALPHA) { ++ if (png_get_color_type(png_ptr, info_ptr)==PNG_COLOR_TYPE_RGB || ++ png_get_color_type(png_ptr, info_ptr)==PNG_COLOR_TYPE_RGB_ALPHA) { + +- if(! (info_ptr->valid & PNG_INFO_PLTE)) { ++ if(! (png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE))) { + #ifdef DEBUG_PNG + fprintf(stderr,"dithering (RGB->palette)...\n"); + #endif +@@ -155,38 +151,45 @@ then dither the image to 256 colors, and + + /* this should probably be dithering to + Rdata.colors_per_inlined_image colors */ +- png_set_dither(png_ptr, std_color_cube, 216, 216, NULL, 1); ++ png_set_quantize(png_ptr, std_color_cube, 216, 216, NULL, 1); + } else { ++ png_colorp palette; ++ int num_palette; ++ png_uint_16p hist; ++ png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette); ++ png_get_hIST(png_ptr, info_ptr, &hist); + #ifdef DEBUG_PNG + fprintf(stderr,"dithering (RGB->file supplied palette)...\n"); + #endif +- png_set_dither(png_ptr, info_ptr->palette, +- info_ptr->num_palette, ++ png_set_quantize(png_ptr, palette, ++ num_palette, + mMosaicAppData.colors_per_inlined_image, +- info_ptr->hist, 1); ++ hist, 1); + } + } + /* PNG files pack pixels of bit depths 1, 2, and 4 into bytes as + small as they can. This expands pixels to 1 pixel per byte, and + if a transparency value is supplied, an alpha channel is + built.*/ +- if (info_ptr->bit_depth < 8) ++ if (png_get_bit_depth(png_ptr, info_ptr) < 8) + png_set_packing(png_ptr); + + /* have libpng handle the gamma conversion */ + + if (mMosaicAppData.use_screen_gamma) { /*SWP*/ +- if (info_ptr->bit_depth != 16) { /* temporary .. glennrp */ ++ if (png_get_bit_depth(png_ptr, info_ptr) != 16) { /* temporary .. glennrp */ + screen_gamma=(double)(mMosaicAppData.screen_gamma); + + #ifdef DEBUG_PNG + fprintf(stderr,"screen gamma=%f\n",screen_gamma); + #endif +- if (info_ptr->valid & PNG_INFO_gAMA) { ++ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA)) { ++ double gamma; ++ png_get_gAMA(png_ptr, info_ptr, &gamma); + #ifdef DEBUG_PNG +- printf("setting gamma=%f\n",info_ptr->gamma); ++ printf("setting gamma=%f\n",gamma); + #endif +- png_set_gamma(png_ptr, screen_gamma, (double)info_ptr->gamma); ++ png_set_gamma(png_ptr, screen_gamma, (double)gamma); + } else { + #ifdef DEBUG_PNG + fprintf(stderr,"setting gamma=%f\n",0.45); +@@ -196,41 +199,44 @@ then dither the image to 256 colors, and + } + } + +- if (info_ptr->interlace_type) ++ if (png_get_interlace_type(png_ptr, info_ptr)) + png_set_interlace_handling(png_ptr); + + png_read_update_info(png_ptr, info_ptr); + + #ifdef DEBUG_PNG +- fprintf(stderr,"\n\nAFTER\nheight = %d\n", (int)png_ptr->width); +- fprintf(stderr,"width = %d\n", (int)png_ptr->height); +- fprintf(stderr,"bit depth = %d\n", info_ptr->bit_depth); +- fprintf(stderr,"color type = %d\n", info_ptr->color_type); ++ fprintf(stderr,"\n\nAFTER\nheight = %d\n", (int)png_get_image_width(png_ptr, info_ptr)); ++ fprintf(stderr,"width = %d\n", (int)png_get_image_height(png_ptr, info_ptr)); ++ fprintf(stderr,"bit depth = %d\n", png_get_bit_depth(png_ptr, info_ptr)); ++ fprintf(stderr,"color type = %d\n", png_get_color_type(png_ptr, info_ptr)); + fprintf(stderr,"compression type = %d\n", info_ptr->compression_type); + fprintf(stderr,"filter type = %d\n", info_ptr->filter_type); + fprintf(stderr,"interlace type = %d\n", info_ptr->interlace_type); + fprintf(stderr,"num colors = %d\n",info_ptr->num_palette); +- fprintf(stderr,"rowbytes = %d\n", info_ptr->rowbytes); ++ fprintf(stderr,"rowbytes = %d\n", png_get_rowbytes(png_ptr, info_ptr)); + #endif + /* allocate the pixel grid which we will need to send to png_read_image(). */ +- png_pixels = (png_byte *)malloc(info_ptr->rowbytes * ++ png_pixels = (png_byte *)malloc(png_get_rowbytes(png_ptr, info_ptr) * + (*height) * sizeof(png_byte)); + + row_pointers = (png_byte **) calloc((*height) , sizeof(png_byte *)); + for (i=0; i < *height; i++) +- row_pointers[i]=png_pixels+(info_ptr->rowbytes*i); ++ row_pointers[i]=png_pixels+(png_get_rowbytes(png_ptr, info_ptr)*i); + + /* FINALLY - read the darn thing. */ + png_read_image(png_ptr, row_pointers); + + /* now that we have the (transformed to 8-bit RGB) image, we have + to copy the resulting palette to our colormap. */ +- if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) { +- if (info_ptr->valid & PNG_INFO_PLTE) { +- for (i=0; i < info_ptr->num_palette; i++) { +- colrs[i].red = info_ptr->palette[i].red << 8; +- colrs[i].green = info_ptr->palette[i].green << 8; +- colrs[i].blue = info_ptr->palette[i].blue << 8; ++ if (png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_COLOR) { ++ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE)) { ++ png_colorp palette; ++ int num_palette; ++ png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette); ++ for (i=0; i < num_palette; i++) { ++ colrs[i].red = palette[i].red << 8; ++ colrs[i].green = palette[i].green << 8; ++ colrs[i].blue = palette[i].blue << 8; + colrs[i].pixel = i; + colrs[i].flags = DoRed|DoGreen|DoBlue; + } +@@ -257,7 +263,7 @@ to copy the resulting palette to our col + p = pixmap; q = png_pixels; + /* if there is an alpha channel, we have to get rid of it in the + pixmap, since I don't do anything with it yet */ +- if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) { ++ if (png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA) { + #ifdef DEBUG_PNG + fprintf(stderr,"Getting rid of alpha channel\n"); + #endif +@@ -283,10 +289,7 @@ pixmap, since I don't do anything with i } free((png_byte **)row_pointers); /* clean up after the read, and free any memory allocated */ diff --git a/www/mMosaic/patches/patch-src_MIME.c b/www/mMosaic/patches/patch-src_MIME.c new file mode 100644 index 00000000000..b18c000fbca --- /dev/null +++ b/www/mMosaic/patches/patch-src_MIME.c @@ -0,0 +1,24 @@ +$NetBSD: patch-src_MIME.c,v 1.1.2.2 2011/04/06 22:17:44 tron Exp $ + +Fix conflict in prototypes with NetBSD native getline(). + +--- src/MIME.c.orig 2000-10-12 12:30:15.000000000 +0000 ++++ src/MIME.c +@@ -311,7 +311,7 @@ static void HTSetSuffix ( const char *su + + #define MAX_STRING_LEN 256 + +-static int getline(char *s, int n, FILE *f) ++static int mm_getline(char *s, int n, FILE *f) + { + register int i=0; + +@@ -353,7 +353,7 @@ static void HTLoadExtensionsConfigFile ( + return ; + } + +- while(!(getline(l,MAX_STRING_LEN,f))) { ++ while(!(mm_getline(l,MAX_STRING_LEN,f))) { + /* always get rid of leading white space for "line" -- SWP */ + for (ptr=l; *ptr && isspace(*ptr); ptr++) + ; |