diff options
author | wiz <wiz> | 2011-01-15 16:22:11 +0000 |
---|---|---|
committer | wiz <wiz> | 2011-01-15 16:22:11 +0000 |
commit | 26c3cf81818f779040f7e2bef065d6119cdf8043 (patch) | |
tree | f297c1f2a3f3dc02f95c6c41954057d95cf763c5 /graphics | |
parent | 27283f8d5607d9ac7042379d694b629d2092c6a1 (diff) | |
download | pkgsrc-26c3cf81818f779040f7e2bef065d6119cdf8043.tar.gz |
Fix build with png-1.5.
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/gimp/distinfo | 3 | ||||
-rw-r--r-- | graphics/gimp/patches/patch-af | 352 | ||||
-rw-r--r-- | graphics/vigra/distinfo | 4 | ||||
-rw-r--r-- | graphics/vigra/patches/patch-ab | 218 |
4 files changed, 570 insertions, 7 deletions
diff --git a/graphics/gimp/distinfo b/graphics/gimp/distinfo index ab5d3ef11cd..645324b9b86 100644 --- a/graphics/gimp/distinfo +++ b/graphics/gimp/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.58 2011/01/15 15:35:23 wiz Exp $ +$NetBSD: distinfo,v 1.59 2011/01/15 16:22:11 wiz Exp $ SHA1 (gimp-2.6.11.tar.bz2) = 2f9d596e727bdbf304fa78257c1731d9faf3934c RMD160 (gimp-2.6.11.tar.bz2) = a116377499e58dc2bfe231ab3c057d0be94091ff @@ -8,3 +8,4 @@ SHA1 (patch-ab) = 80e7235178e53e873efa0b16098b74fa0b981f76 SHA1 (patch-ac) = 42f44b45640bdde305c1e52b95ee633360ebccb8 SHA1 (patch-ad) = 4e2ce2f7d8729fb760eac1bad89cfe09fef499b0 SHA1 (patch-ae) = 2609a048d7ba5323d29402fe384dbf96980eed1d +SHA1 (patch-af) = f183f3bc39a995c20adecd8d0fe98e5150e1263d diff --git a/graphics/gimp/patches/patch-af b/graphics/gimp/patches/patch-af new file mode 100644 index 00000000000..7813d4676fe --- /dev/null +++ b/graphics/gimp/patches/patch-af @@ -0,0 +1,352 @@ +$NetBSD: patch-af,v 1.5 2011/01/15 16:22:11 wiz Exp $ + +Fix build with png-1.5. + +--- plug-ins/common/file-png.c.orig 2010-07-13 20:22:27.000000000 +0000 ++++ plug-ins/common/file-png.c +@@ -653,7 +653,11 @@ on_read_error (png_structp png_ptr, png_ + error_data->drawable->width, num); + } + ++#if (PNG_LIBPNG_VER < 10500) + longjmp (png_ptr->jmpbuf, 1); ++#else ++ png_longjmp (png_ptr, 1); ++#endif + } + + /* +@@ -697,7 +701,7 @@ load_image (const gchar *filename, + pp = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + info = png_create_info_struct (pp); + +- if (setjmp (pp->jmpbuf)) ++ if (setjmp (png_jmpbuf(pp))) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("Error while reading '%s'. File corrupted?"), +@@ -738,17 +742,17 @@ load_image (const gchar *filename, + * Latest attempt, this should be my best yet :) + */ + +- if (info->bit_depth == 16) ++ if (png_get_bit_depth(pp, info) == 16) + { + png_set_strip_16 (pp); + } + +- if (info->color_type == PNG_COLOR_TYPE_GRAY && info->bit_depth < 8) ++ if (png_get_color_type(pp, info) == PNG_COLOR_TYPE_GRAY && png_get_bit_depth(pp, info) < 8) + { + png_set_expand (pp); + } + +- if (info->color_type == PNG_COLOR_TYPE_PALETTE && info->bit_depth < 8) ++ if (png_get_color_type(pp, info) == PNG_COLOR_TYPE_PALETTE && png_get_bit_depth(pp, info) < 8) + { + png_set_packing (pp); + } +@@ -757,8 +761,8 @@ load_image (const gchar *filename, + * Expand G+tRNS to GA, RGB+tRNS to RGBA + */ + +- if (info->color_type != PNG_COLOR_TYPE_PALETTE && +- (info->valid & PNG_INFO_tRNS)) ++ if (png_get_color_type(pp, info) != PNG_COLOR_TYPE_PALETTE && ++ png_get_valid(pp, info, PNG_INFO_tRNS) != 0) + { + png_set_expand (pp); + } +@@ -775,7 +779,7 @@ load_image (const gchar *filename, + */ + + if (png_get_valid (pp, info, PNG_INFO_tRNS) && +- info->color_type == PNG_COLOR_TYPE_PALETTE) ++ png_get_color_type(pp, info) == PNG_COLOR_TYPE_PALETTE) + { + png_get_tRNS (pp, info, &alpha_ptr, &num, NULL); + /* Copy the existing alpha values from the tRNS chunk */ +@@ -797,7 +801,7 @@ load_image (const gchar *filename, + + png_read_update_info (pp, info); + +- switch (info->color_type) ++ switch (png_get_color_type(pp, info)) + { + case PNG_COLOR_TYPE_RGB: /* RGB */ + bpp = 3; +@@ -836,7 +840,7 @@ load_image (const gchar *filename, + return -1; + } + +- image = gimp_image_new (info->width, info->height, image_type); ++ image = gimp_image_new (png_get_image_width(pp, info), png_get_image_height(pp, info), image_type); + if (image == -1) + { + g_set_error (error, 0, 0, +@@ -849,7 +853,7 @@ load_image (const gchar *filename, + * Create the "background" layer to hold the image... + */ + +- layer = gimp_layer_new (image, _("Background"), info->width, info->height, ++ layer = gimp_layer_new (image, _("Background"), png_get_image_width(pp, info), png_get_image_height(pp, info), + layer_type, 100, GIMP_NORMAL_MODE); + gimp_image_add_layer (image, layer, 0); + +@@ -883,7 +887,7 @@ load_image (const gchar *filename, + + gimp_layer_set_offsets (layer, offset_x, offset_y); + +- if ((abs (offset_x) > info->width) || (abs (offset_y) > info->height)) ++ if ((abs (offset_x) > png_get_image_width(pp, info)) || (abs (offset_y) > png_get_image_height(pp, info))) + { + if (interactive) + g_message (_("The PNG file specifies an offset that caused " +@@ -938,23 +942,27 @@ load_image (const gchar *filename, + + empty = 0; /* by default assume no full transparent palette entries */ + +- if (info->color_type & PNG_COLOR_MASK_PALETTE) ++ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_PALETTE) + { ++ png_colorp palette; ++ int num_palette; ++ png_get_PLTE(pp, info, &palette, &num_palette); ++ + if (png_get_valid (pp, info, PNG_INFO_tRNS)) + { + for (empty = 0; empty < 256 && alpha[empty] == 0; ++empty) + /* Calculates number of fully transparent "empty" entries */; + + /* keep at least one entry */ +- empty = MIN (empty, info->num_palette - 1); ++ empty = MIN (empty, num_palette - 1); + +- gimp_image_set_colormap (image, (guchar *) (info->palette + empty), +- info->num_palette - empty); ++ gimp_image_set_colormap (image, (guchar *) (palette + empty), ++ num_palette - empty); + } + else + { +- gimp_image_set_colormap (image, (guchar *) info->palette, +- info->num_palette); ++ gimp_image_set_colormap (image, (guchar *) palette, ++ num_palette); + } + } + +@@ -972,18 +980,18 @@ load_image (const gchar *filename, + */ + + tile_height = gimp_tile_height (); +- pixel = g_new0 (guchar, tile_height * info->width * bpp); ++ pixel = g_new0 (guchar, tile_height * png_get_image_width(pp, info) * bpp); + pixels = g_new (guchar *, tile_height); + + for (i = 0; i < tile_height; i++) +- pixels[i] = pixel + info->width * info->channels * i; ++ pixels[i] = pixel + png_get_image_width(pp, info) * png_get_channels(pp, info) * i; + + /* Install our own error handler to handle incomplete PNG files better */ + error_data.drawable = drawable; + error_data.pixel = pixel; + error_data.tile_height = tile_height; +- error_data.width = info->width; +- error_data.height = info->height; ++ error_data.width = png_get_image_width(pp, info); ++ error_data.height = png_get_image_height(pp, info); + error_data.bpp = bpp; + error_data.pixel_rgn = &pixel_rgn; + +@@ -996,10 +1004,10 @@ load_image (const gchar *filename, + */ + + for (begin = 0, end = tile_height; +- begin < info->height; begin += tile_height, end += tile_height) ++ begin < png_get_image_height(pp, info); begin += tile_height, end += tile_height) + { +- if (end > info->height) +- end = info->height; ++ if (end > png_get_image_height(pp, info)) ++ end = png_get_image_height(pp, info); + + num = end - begin; + +@@ -1016,10 +1024,10 @@ load_image (const gchar *filename, + gimp_pixel_rgn_set_rect (&pixel_rgn, pixel, 0, begin, + drawable->width, num); + +- memset (pixel, 0, tile_height * info->width * bpp); ++ memset (pixel, 0, tile_height * png_get_image_width(pp, info) * bpp); + + gimp_progress_update (((gdouble) pass + +- (gdouble) end / (gdouble) info->height) / ++ (gdouble) end / (gdouble) png_get_image_height(pp, info)) / + (gdouble) num_passes); + } + } +@@ -1072,7 +1080,8 @@ load_image (const gchar *filename, + + { + png_uint_32 proflen; +- png_charp profname, profile; ++ png_charp profname; ++ png_bytep profile; + int profcomp; + + if (png_get_iCCP (pp, info, &profname, &profcomp, &profile, &proflen)) +@@ -1200,6 +1209,8 @@ save_image (const gchar *filename, + guchar red, green, blue; /* Used for palette background */ + time_t cutime; /* Time since epoch */ + struct tm *gmt; /* GMT broken down */ ++ int color_type; /* type of colors in image */ ++ int bit_depth; /* width of colors in bit */ + + guchar remap[256]; /* Re-mapping for the palette */ + +@@ -1208,7 +1219,9 @@ save_image (const gchar *filename, + if (pngvals.comment) + { + GimpParasite *parasite; ++#ifndef PNG_iTXt_SUPPORTED + gsize text_length = 0; ++#endif + + parasite = gimp_image_parasite_find (orig_image_ID, "gimp-comment"); + if (parasite) +@@ -1249,7 +1262,7 @@ save_image (const gchar *filename, + pp = png_create_write_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + info = png_create_info_struct (pp); + +- if (setjmp (pp->jmpbuf)) ++ if (setjmp (png_jmpbuf(pp))) + { + g_set_error (error, 0, 0, + _("Error while saving '%s'. Could not save image."), +@@ -1291,11 +1304,6 @@ save_image (const gchar *filename, + + png_set_compression_level (pp, pngvals.compression_level); + +- info->width = drawable->width; +- info->height = drawable->height; +- info->bit_depth = 8; +- info->interlace_type = pngvals.interlaced; +- + /* + * Initialise remap[] + */ +@@ -1309,37 +1317,34 @@ save_image (const gchar *filename, + switch (type) + { + case GIMP_RGB_IMAGE: +- info->color_type = PNG_COLOR_TYPE_RGB; ++ color_type = PNG_COLOR_TYPE_RGB; + bpp = 3; + break; + + case GIMP_RGBA_IMAGE: +- info->color_type = PNG_COLOR_TYPE_RGB_ALPHA; ++ color_type = PNG_COLOR_TYPE_RGB_ALPHA; + bpp = 4; + break; + + case GIMP_GRAY_IMAGE: +- info->color_type = PNG_COLOR_TYPE_GRAY; ++ color_type = PNG_COLOR_TYPE_GRAY; + bpp = 1; + break; + + case GIMP_GRAYA_IMAGE: +- info->color_type = PNG_COLOR_TYPE_GRAY_ALPHA; ++ color_type = PNG_COLOR_TYPE_GRAY_ALPHA; + bpp = 2; + break; + + case GIMP_INDEXED_IMAGE: + bpp = 1; +- info->color_type = PNG_COLOR_TYPE_PALETTE; +- info->valid |= PNG_INFO_PLTE; +- info->palette = +- (png_colorp) gimp_image_get_colormap (image_ID, &num_colors); +- info->num_palette = num_colors; ++ color_type = PNG_COLOR_TYPE_PALETTE; ++ png_set_PLTE(pp, info, (png_colorp) gimp_image_get_colormap (image_ID, &num_colors), num_colors); + break; + + case GIMP_INDEXEDA_IMAGE: + bpp = 2; +- info->color_type = PNG_COLOR_TYPE_PALETTE; ++ color_type = PNG_COLOR_TYPE_PALETTE; + /* fix up transparency */ + respin_cmap (pp, info, remap, image_ID, drawable); + break; +@@ -1353,17 +1358,25 @@ save_image (const gchar *filename, + * Fix bit depths for (possibly) smaller colormap images + */ + +- if (info->valid & PNG_INFO_PLTE) ++ bit_depth = 8; ++ ++ if (png_get_valid(pp, info, PNG_INFO_PLTE)) + { +- if (info->num_palette <= 2) +- info->bit_depth = 1; +- else if (info->num_palette <= 4) +- info->bit_depth = 2; +- else if (info->num_palette <= 16) +- info->bit_depth = 4; ++ png_colorp palette; ++ int num_palette; ++ png_get_PLTE(pp, info, &palette, &num_palette); ++ ++ if (num_palette <= 2) ++ bit_depth = 1; ++ else if (num_palette <= 4) ++ bit_depth = 2; ++ else if (num_palette <= 16) ++ bit_depth = 4; + /* otherwise the default is fine */ + } + ++ png_set_IHDR(pp, info, drawable->width, drawable->height, bit_depth, color_type, PNG_FILTER_TYPE_BASE, PNG_COMPRESSION_TYPE_BASE, pngvals.interlaced ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE); ++ + /* All this stuff is optional extras, if the user is aiming for smallest + possible file size she can turn them all off */ + +@@ -1477,7 +1490,7 @@ save_image (const gchar *filename, + * Convert unpacked pixels to packed if necessary + */ + +- if (info->color_type == PNG_COLOR_TYPE_PALETTE && info->bit_depth < 8) ++ if (png_get_color_type(pp, info) == PNG_COLOR_TYPE_PALETTE && png_get_bit_depth(pp, info) < 8) + png_set_packing (pp); + + /* +@@ -1529,7 +1542,7 @@ save_image (const gchar *filename, + + /* If we're dealing with a paletted image with + * transparency set, write out the remapped palette */ +- if (info->valid & PNG_INFO_tRNS) ++ if (png_get_valid(pp, info, PNG_INFO_tRNS)) + { + guchar inverse_remap[256]; + +@@ -1549,7 +1562,7 @@ save_image (const gchar *filename, + } + /* Otherwise if we have a paletted image and transparency + * couldn't be set, we ignore the alpha channel */ +- else if (info->valid & PNG_INFO_PLTE && bpp == 2) ++ else if (png_get_valid(pp, info, PNG_INFO_PLTE) && bpp == 2) + { + for (i = 0; i < num; ++i) + { +@@ -1564,7 +1577,7 @@ save_image (const gchar *filename, + png_write_rows (pp, pixels, num); + + gimp_progress_update (((double) pass + (double) end / +- (double) info->height) / ++ (double) png_get_image_height(pp, info)) / + (double) num_passes); + } + } diff --git a/graphics/vigra/distinfo b/graphics/vigra/distinfo index e9e643e7c2a..5486ce879eb 100644 --- a/graphics/vigra/distinfo +++ b/graphics/vigra/distinfo @@ -1,6 +1,6 @@ -$NetBSD: distinfo,v 1.3 2010/10/16 15:50:21 wiz Exp $ +$NetBSD: distinfo,v 1.4 2011/01/15 16:31:18 wiz Exp $ SHA1 (vigra-1.7.0-src.tar.gz) = 31875646cbb1928d93c96fc4da4fda31772cf8f6 RMD160 (vigra-1.7.0-src.tar.gz) = 496479bcf133c3352ffad146308b7496f2fa4d9b Size (vigra-1.7.0-src.tar.gz) = 26637626 bytes -SHA1 (patch-ab) = 10a50856d690fc2ad41f14e9fe0817b162c11586 +SHA1 (patch-ab) = e9104d7804bfe51cd2abca29a6d4850f578cd5fc diff --git a/graphics/vigra/patches/patch-ab b/graphics/vigra/patches/patch-ab index dedcebcec7b..7ee45b576d6 100644 --- a/graphics/vigra/patches/patch-ab +++ b/graphics/vigra/patches/patch-ab @@ -1,17 +1,227 @@ -$NetBSD: patch-ab,v 1.2 2010/10/16 15:50:21 wiz Exp $ +$NetBSD: patch-ab,v 1.3 2011/01/15 16:31:18 wiz Exp $ Fix compilation with png-1.4, already included upstream. +Fix build with png-1.5. ---- src/impex/png.cxx.orig 2008-08-13 13:15:45.000000000 +0000 +--- src/impex/png.cxx.orig 2010-04-20 16:29:02.000000000 +0000 +++ src/impex/png.cxx -@@ -270,8 +270,8 @@ namespace vigra { +@@ -75,7 +75,11 @@ extern "C" { + static void PngError( png_structp png_ptr, png_const_charp error_msg ) + { + png_error_message = std::string(error_msg); ++#if (PNG_LIBPNG_VER < 10500) + longjmp( png_ptr->jmpbuf, 1 ); ++#else ++ png_longjmp( png_ptr, 1 ); ++#endif + } + + // called on non-fatal errors +@@ -207,7 +211,7 @@ namespace vigra { + vigra_postcondition( png != 0, "could not create the read struct." ); + + // create info struct +- if (setjmp(png->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png))) { + png_destroy_read_struct( &png, &info, NULL ); + vigra_postcondition( false, png_error_message.insert(0, "error in png_create_info_struct(): ").c_str() ); + } +@@ -215,14 +219,14 @@ namespace vigra { + vigra_postcondition( info != 0, "could not create the info struct." ); + + // init png i/o +- if (setjmp(png->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png))) { + png_destroy_read_struct( &png, &info, NULL ); + vigra_postcondition( false, png_error_message.insert(0, "error in png_init_io(): ").c_str() ); + } + png_init_io( png, file.get() ); + + // specify that the signature was already read +- if (setjmp(png->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png))) { + png_destroy_read_struct( &png, &info, NULL ); + vigra_postcondition( false, png_error_message.insert(0, "error in png_set_sig_bytes(): ").c_str() ); + } +@@ -238,13 +242,13 @@ namespace vigra { + void PngDecoderImpl::init() + { + // read all chunks up to the image data +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_read_info(): ").c_str() ); + png_read_info( png, info ); + + // pull over the header fields + int interlace_method, compression_method, filter_method; +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_get_IHDR(): ").c_str() ); + png_get_IHDR( png, info, &width, &height, &bit_depth, &color_type, + &interlace_method, &compression_method, &filter_method ); +@@ -258,7 +262,7 @@ namespace vigra { + + // transform palette to rgb + if ( color_type == PNG_COLOR_TYPE_PALETTE) { +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_palette_to_rgb(): ").c_str() ); + png_set_palette_to_rgb(png); + color_type = PNG_COLOR_TYPE_RGB; +@@ -267,9 +271,9 @@ namespace vigra { + // expand gray values to at least one byte size if ( color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8 ) { - if (setjmp(png->jmpbuf)) +- if (setjmp(png->jmpbuf)) - vigra_postcondition( false,png_error_message.insert(0, "error in png_set_gray_1_2_4_to_8(): ").c_str()); - png_set_gray_1_2_4_to_8(png); ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false,png_error_message.insert(0, "error in png_set_expand_gray_1_2_4_to_8(): ").c_str()); + png_set_expand_gray_1_2_4_to_8(png); bit_depth = 8; } +@@ -277,7 +281,7 @@ namespace vigra { + #if 0 + // strip alpha channel + if ( color_type & PNG_COLOR_MASK_ALPHA ) { +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_set_strip_alpha(): ").c_str() ); + png_set_strip_alpha(png); + color_type ^= PNG_COLOR_MASK_ALPHA; +@@ -319,9 +323,9 @@ namespace vigra { + #if (PNG_LIBPNG_VER > 10008) && defined(PNG_READ_iCCP_SUPPORTED) + char * dummyName; + int dummyCompType; +- char * profilePtr; ++ png_byte * profilePtr; + png_uint_32 profileLen; +- if (info->valid & PNG_INFO_iCCP) { ++ if (png_get_valid(png, info, PNG_INFO_iCCP)) { + png_get_iCCP(png, info, &dummyName, &dummyCompType, &profilePtr, &profileLen) ; + iccProfilePtr = (unsigned char *) profilePtr; + iccProfileLength = profileLen; +@@ -334,7 +338,7 @@ namespace vigra { + // image gamma + double image_gamma = 0.45455; + if ( png_get_valid( png, info, PNG_INFO_gAMA ) ) { +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_get_gAMA(): ").c_str() ); + png_get_gAMA( png, info, &image_gamma ); + } +@@ -343,26 +347,26 @@ namespace vigra { + double screen_gamma = 2.2; + + // set gamma correction +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_set_gamma(): ").c_str() ); + png_set_gamma( png, screen_gamma, image_gamma ); + #endif + + // interlace handling, get number of read passes needed +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false,png_error_message.insert(0, "error in png_set_interlace_handling(): ").c_str()); + n_interlace_passes = png_set_interlace_handling(png); + + // update png library state to reflect any changes that were made +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_read_update_info(): ").c_str() ); + png_read_update_info( png, info ); + +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false,png_error_message.insert(0, "error in png_get_channels(): ").c_str()); + n_channels = png_get_channels(png, info); + +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false,png_error_message.insert(0, "error in png_get_rowbytes(): ").c_str()); + rowsize = png_get_rowbytes(png, info); + +@@ -373,7 +377,7 @@ namespace vigra { + void PngDecoderImpl::nextScanline() + { + for (int i=0; i < n_interlace_passes; i++) { +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false,png_error_message.insert(0, "error in png_read_row(): ").c_str()); + png_read_row(png, row_data.begin(), NULL); + } +@@ -539,7 +543,7 @@ namespace vigra { + vigra_postcondition( png != 0, "could not create the write struct." ); + + // create info struct +- if (setjmp(png->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png))) { + png_destroy_write_struct( &png, &info ); + vigra_postcondition( false, png_error_message.insert(0, "error in png_info_struct(): ").c_str() ); + } +@@ -550,7 +554,7 @@ namespace vigra { + } + + // init png i/o +- if (setjmp(png->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png))) { + png_destroy_write_struct( &png, &info ); + vigra_postcondition( false, png_error_message.insert(0, "error in png_init_io(): ").c_str() ); + } +@@ -565,7 +569,7 @@ namespace vigra { + void PngEncoderImpl::finalize() + { + // write the IHDR +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_set_IHDR(): ").c_str() ); + png_set_IHDR( png, info, width, height, bit_depth, color_type, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, +@@ -573,7 +577,7 @@ namespace vigra { + + // set resolution + if (x_resolution > 0 && y_resolution > 0) { +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_set_pHYs(): ").c_str() ); + png_set_pHYs(png, info, (png_uint_32) (x_resolution / 0.0254 + 0.5), + (png_uint_32) (y_resolution / 0.0254 + 0.5), +@@ -582,7 +586,7 @@ namespace vigra { + + // set offset + if (position.x > 0 && position.y > 0) { +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_set_oFFs(): ").c_str() ); + png_set_oFFs(png, info, position.x, position.y, PNG_OFFSET_PIXEL); + } +@@ -591,12 +595,12 @@ namespace vigra { + // set icc profile + if (iccProfile.size() > 0) { + png_set_iCCP(png, info, const_cast<char*>("icc"), 0, +- (char *)iccProfile.begin(), (png_uint_32)iccProfile.size()); ++ (png_bytep)iccProfile.begin(), (png_uint_32)iccProfile.size()); + } + #endif + + // write the info struct +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_write_info(): ").c_str() ); + png_write_info( png, info ); + +@@ -628,10 +632,10 @@ namespace vigra { + } + + // write the whole image +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_write_image(): ").c_str() ); + png_write_image( png, row_pointers.begin() ); +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + vigra_postcondition( false, png_error_message.insert(0, "error in png_write_end(): ").c_str() ); + png_write_end(png, info); + } |