head 1.6; access; symbols pkgsrc-2013Q2:1.6.0.8 pkgsrc-2013Q2-base:1.6 pkgsrc-2012Q4:1.6.0.6 pkgsrc-2012Q4-base:1.6 pkgsrc-2011Q4:1.6.0.4 pkgsrc-2011Q4-base:1.6 pkgsrc-2011Q2:1.6.0.2 pkgsrc-2011Q2-base:1.6 pkgsrc-2011Q1:1.4.0.8 pkgsrc-2011Q1-base:1.4 pkgsrc-2010Q4:1.4.0.6 pkgsrc-2010Q4-base:1.4 pkgsrc-2010Q3:1.4.0.4 pkgsrc-2010Q3-base:1.4 pkgsrc-2010Q2:1.4.0.2 pkgsrc-2010Q2-base:1.4 pkgsrc-2010Q1:1.3.0.64 pkgsrc-2010Q1-base:1.3 pkgsrc-2009Q4:1.3.0.62 pkgsrc-2009Q4-base:1.3 pkgsrc-2009Q3:1.3.0.60 pkgsrc-2009Q3-base:1.3 pkgsrc-2009Q2:1.3.0.58 pkgsrc-2009Q2-base:1.3 pkgsrc-2009Q1:1.3.0.56 pkgsrc-2009Q1-base:1.3 pkgsrc-2008Q4:1.3.0.54 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.52 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.50 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.48 pkgsrc-2008Q2-base:1.3 cwrapper:1.3.0.46 pkgsrc-2008Q1:1.3.0.44 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.42 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.40 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.38 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.36 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.3.0.34 pkgsrc-2006Q4-base:1.3 pkgsrc-2006Q3:1.3.0.32 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.30 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.28 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.26 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.3.0.24 pkgsrc-2005Q3-base:1.3 pkgsrc-2005Q2:1.3.0.22 pkgsrc-2005Q2-base:1.3 pkgsrc-2005Q1:1.3.0.20 pkgsrc-2005Q1-base:1.3 pkgsrc-2004Q4:1.3.0.18 pkgsrc-2004Q4-base:1.3 pkgsrc-2004Q3:1.3.0.16 pkgsrc-2004Q3-base:1.3 pkgsrc-2004Q2:1.3.0.14 pkgsrc-2004Q2-base:1.3 pkgsrc-2004Q1:1.3.0.12 pkgsrc-2004Q1-base:1.3 pkgsrc-2003Q4:1.3.0.10 pkgsrc-2003Q4-base:1.3 netbsd-1-6-1:1.3.0.6 netbsd-1-6-1-base:1.3 netbsd-1-6:1.3.0.8 netbsd-1-6-RELEASE-base:1.3 pkgviews:1.3.0.4 pkgviews-base:1.3 buildlink2:1.3.0.2 buildlink2-base:1.3 netbsd-1-5-PATCH003:1.3 netbsd-1-5-PATCH001:1.2 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.6 date 2011.06.15.17.44.52; author wiz; state dead; branches; next 1.5; 1.5 date 2011.04.05.12.16.39; author wiz; state Exp; branches; next 1.4; 1.4 date 2010.06.13.22.45.32; author wiz; state Exp; branches 1.4.8.1; next 1.3; 1.3 date 2002.03.15.00.07.37; author fredb; state Exp; branches; next 1.2; 1.2 date 2000.10.26.11.17.35; author abs; state Exp; branches; next 1.1; 1.1 date 2000.10.19.14.23.01; author fredb; state Exp; branches 1.1.1.1; next ; 1.4.8.1 date 2011.04.06.22.17.43; author tron; state Exp; branches; next ; 1.1.1.1 date 2000.10.19.14.23.01; author fredb; state Exp; branches; next ; desc @@ 1.6 log @Remove chimera. Last update from 2002, and that's a long time for a web browser. No dissent on pkgsrc-users. @ text @$NetBSD: patch-ad,v 1.5 2011/04/05 12:16:39 wiz Exp $ Fix build with png-1.5. --- image/png.c.orig 1999-03-29 02:23:46.000000000 +0000 +++ image/png.c @@@@ -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) { - if (info->trans[i] < info->trans[val]) + for (i = 0; i < num_trans; ++i) { + if (trans_alpha[i] < trans_alpha[val]) val = i; } png->image->transparent = val; } - } 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) - png->image->transparent = info->trans_values.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(png_get_image_width(state, info), png_get_image_height(state, info)); if (!png->image) { 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) { - png_read_destroy(png->state, png->info, (png_info *) 0); - free_mem(png->state); + if ((png->state) && (png->info)) { + png_destroy_read_struct(&png->state, &png->info, (png_info **)NULL); png->state = 0; } - if (png->info) { - free_mem(png->info); - png->info = 0; - } - if (png->image) { freeImage(png->image); png->image = 0; @@@@ -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; - png->state = (png_struct *) alloc_mem(sizeof(png_struct)); + png->state = (png_struct *) png_create_read_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); if (!png->state) return; - png->info = (png_info *) alloc_mem(sizeof(png_info)); + png->info = (png_info *) png_create_info_struct(png->state); if (!png->info) { - free_mem(png->state); + png_destroy_read_struct(&png->state, NULL, (png_info **)NULL); return; } - 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; } - png_info_init(png->info); - png_read_init(png->state); - png_set_progressive_read_fn(png->state, (void *) png, lf_info_callback, lf_row_callback, lf_end_callback); png->done = image_need_data; @ 1.5 log @Fix build with png-1.5. @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.4 2010/06/13 22:45:32 wiz Exp $ @ 1.4 log @Bump PKGREVISION for libpng shlib name change. Also add some patches to remove use of deprecated symbols and fix other problems when looking for or compiling against libpng-1.4.x. @ text @d1 3 a3 1 $NetBSD: patch-ad,v 1.3 2002/03/15 00:07:37 fredb Exp $ d7 90 a96 1 @@@@ -126,7 +126,7 @@@@ lf_info_callback(png_struct *state, png_ d98 1 d100 1 a100 1 for (i = 0; i < info->num_trans; ++i) { d102 2 a103 1 + if (info->trans_alpha[i] < info->trans_alpha[val]) d107 15 a121 1 @@@@ -154,7 +154,7 @@@@ lf_info_callback(png_struct *state, png_ d124 1 a124 1 if (info->valid & PNG_INFO_tRNS) d126 8 a133 1 + png->image->transparent = info->trans_color.gray; d135 2 a136 1 png->image = newTrueImage(info->width, info->height); d138 40 a177 2 @@@@ -222,17 +222,11 @@@@ pngDestroy(void *pointer) if (setjmp(png->state->jmpbuf)) d196 10 a205 1 @@@@ -275,28 +269,22 @@@@ pngInit(void (*lineProc)(void *, int, in d223 1 a223 1 if (setjmp(png->state->jmpbuf)) { d229 1 @ 1.4.8.1 log @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. @ text @d1 1 a1 3 $NetBSD$ Fix build with png-1.5. d5 1 a5 90 @@@@ -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; a6 1 + png_get_tRNS(state, info, &trans_alpha, &num_trans, &trans_color); d8 1 a8 1 - for (i = 0; i < info->num_trans; ++i) { d10 1 a10 2 + for (i = 0; i < num_trans; ++i) { + if (trans_alpha[i] < trans_alpha[val]) d14 1 a14 15 } - } 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_ } d17 1 a17 1 - if (info->valid & PNG_INFO_tRNS) d19 1 a19 8 + 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; + } d21 1 a21 2 - png->image = newTrueImage(info->width, info->height); + png->image = newTrueImage(png_get_image_width(state, info), png_get_image_height(state, info)); d23 2 a24 40 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))) d43 1 a43 10 @@@@ -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 d61 1 a61 1 - if (setjmp(png->state->jmpbuf)) { a66 1 + if (setjmp(png_jmpbuf(png->state))) { @ 1.3 log @Don't reference the result, if png_create_info_struct() was unsucessful. @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.2 2000/10/26 11:17:35 abs Exp $ d3 1 a3 1 --- image/png.c.orig Mon Mar 29 03:23:46 1999 d5 19 a23 1 @@@@ -222,17 +222,11 @@@@ d43 1 a43 1 @@@@ -275,27 +269,21 @@@@ d70 1 a70 1 - d73 1 a73 1 d76 1 @ 1.2 log @Use sys/endian to determine the byte ordering. Now works on NetBSD/arm32. @ text @d1 1 a1 1 $NetBSD$ d39 1 a39 1 + png_destroy_read_struct(&png->state, &png->info, (png_info **)NULL); @ 1.1 log @Initial revision @ text @d3 2 a4 2 --- image/png.c.orig Sun Mar 28 20:23:46 1999 +++ image/png.c Wed Oct 18 22:56:45 2000 @ 1.1.1.1 log @Initial import of chimera-2.0a19, a WWW browser for X Windows. @ text @@