summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2011-01-15 15:35:23 +0000
committerwiz <wiz@pkgsrc.org>2011-01-15 15:35:23 +0000
commita2e3ebc9f3899e3bfbbfad2ecba7d0885f00562e (patch)
tree4abe03e362ec93ce929c3cc70c7a5a078a1d2ca7 /graphics
parent3d3a6e900ba472c50a2f854fde370614a732d349 (diff)
downloadpkgsrc-a2e3ebc9f3899e3bfbbfad2ecba7d0885f00562e.tar.gz
Fix build of mng code with png-1.5. Still needed: fix for png.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/gimp/distinfo3
-rw-r--r--graphics/gimp/patches/patch-ae126
2 files changed, 128 insertions, 1 deletions
diff --git a/graphics/gimp/distinfo b/graphics/gimp/distinfo
index 03de705644f..ab5d3ef11cd 100644
--- a/graphics/gimp/distinfo
+++ b/graphics/gimp/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.57 2010/10/25 19:06:10 adam Exp $
+$NetBSD: distinfo,v 1.58 2011/01/15 15:35:23 wiz Exp $
SHA1 (gimp-2.6.11.tar.bz2) = 2f9d596e727bdbf304fa78257c1731d9faf3934c
RMD160 (gimp-2.6.11.tar.bz2) = a116377499e58dc2bfe231ab3c057d0be94091ff
@@ -7,3 +7,4 @@ SHA1 (patch-aa) = 0775c8037748bfc27eb610f3667ddaa92d710681
SHA1 (patch-ab) = 80e7235178e53e873efa0b16098b74fa0b981f76
SHA1 (patch-ac) = 42f44b45640bdde305c1e52b95ee633360ebccb8
SHA1 (patch-ad) = 4e2ce2f7d8729fb760eac1bad89cfe09fef499b0
+SHA1 (patch-ae) = 2609a048d7ba5323d29402fe384dbf96980eed1d
diff --git a/graphics/gimp/patches/patch-ae b/graphics/gimp/patches/patch-ae
new file mode 100644
index 00000000000..86fa2125836
--- /dev/null
+++ b/graphics/gimp/patches/patch-ae
@@ -0,0 +1,126 @@
+$NetBSD: patch-ae,v 1.11 2011/01/15 15:35:23 wiz Exp $
+
+Fix build with png-1.5.
+
+--- plug-ins/common/file-mng.c.orig 2010-07-02 22:51:56.000000000 +0000
++++ plug-ins/common/file-mng.c
+@@ -799,6 +799,13 @@ mng_save_image (const gchar *filename,
+ png_infop png_info_ptr;
+ FILE *infile, *outfile;
+ int num_passes;
++ int color_type;
++ png_colorp palette;
++ int num_palette;
++ int bit_depth;
++ png_bytep trans_alpha;
++ int num_trans;
++ png_color_16p trans_color;
+ int tile_height;
+ guchar **layer_pixels, *layer_pixel;
+ int pass, j, k, begin, end, num;
+@@ -969,7 +976,7 @@ mng_save_image (const gchar *filename,
+ goto err3;
+ }
+
+- if (setjmp (png_ptr->jmpbuf) != 0)
++ if (setjmp (png_jmpbuf(png_ptr)) != 0)
+ {
+ g_warning ("HRM saving PNG in mng_save_image()");
+ png_destroy_write_struct (&png_ptr, &png_info_ptr);
+@@ -981,34 +988,27 @@ mng_save_image (const gchar *filename,
+ png_init_io (png_ptr, outfile);
+ png_set_compression_level (png_ptr, mng_data.compression_level);
+
+- png_info_ptr->width = layer_cols;
+- png_info_ptr->height = layer_rows;
+- png_info_ptr->interlace_type = (mng_data.interlaced == 0 ? 0 : 1);
+- png_info_ptr->bit_depth = 8;
+-
+ switch (layer_drawable_type)
+ {
+ case GIMP_RGB_IMAGE:
+- png_info_ptr->color_type = PNG_COLOR_TYPE_RGB;
++ color_type = PNG_COLOR_TYPE_RGB;
+ break;
+ case GIMP_RGBA_IMAGE:
+- png_info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
++ color_type = PNG_COLOR_TYPE_RGB_ALPHA;
+ break;
+ case GIMP_GRAY_IMAGE:
+- png_info_ptr->color_type = PNG_COLOR_TYPE_GRAY;
++ color_type = PNG_COLOR_TYPE_GRAY;
+ break;
+ case GIMP_GRAYA_IMAGE:
+- png_info_ptr->color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
++ color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
+ break;
+ case GIMP_INDEXED_IMAGE:
+- png_info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
+- png_info_ptr->valid |= PNG_INFO_PLTE;
+- png_info_ptr->palette =
+- (png_colorp) gimp_image_get_colormap (image_id, &num_colors);
+- png_info_ptr->num_palette = num_colors;
++ color_type = PNG_COLOR_TYPE_PALETTE;
++
++ png_set_PLTE(png_ptr, png_info_ptr, (png_colorp) gimp_image_get_colormap (image_id, &num_colors), num_colors);
+ break;
+ case GIMP_INDEXEDA_IMAGE:
+- png_info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
++ color_type = PNG_COLOR_TYPE_PALETTE;
+ layer_has_unique_palette =
+ respin_cmap (png_ptr, png_info_ptr, layer_remap,
+ image_id, layer_drawable);
+@@ -1021,15 +1021,17 @@ mng_save_image (const gchar *filename,
+ goto err3;
+ }
+
+- if ((png_info_ptr->valid & PNG_INFO_PLTE) == PNG_INFO_PLTE)
++ bit_depth = 8;
++ if (png_get_PLTE(png_ptr, png_info_ptr, &palette, &num_palette) != 0)
+ {
+- if (png_info_ptr->num_palette <= 2)
+- png_info_ptr->bit_depth = 1;
+- else if (png_info_ptr->num_palette <= 4)
+- png_info_ptr->bit_depth = 2;
+- else if (png_info_ptr->num_palette <= 16)
+- png_info_ptr->bit_depth = 4;
++ if (num_palette <= 2)
++ bit_depth = 1;
++ else if (num_palette <= 4)
++ bit_depth = 2;
++ else if (num_palette <= 16)
++ bit_depth = 4;
+ }
++ png_set_IHDR(png_ptr, png_info_ptr, layer_cols, layer_rows, bit_depth, color_type, (mng_data.interlaced == 0 ? PNG_INTERLACE_NONE : PNG_INTERLACE_ADAM7), PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+
+ png_write_info (png_ptr, png_info_ptr);
+
+@@ -1038,8 +1040,8 @@ mng_save_image (const gchar *filename,
+ else
+ num_passes = 1;
+
+- if ((png_info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) &&
+- (png_info_ptr->bit_depth < 8))
++ if ((png_get_color_type(png_ptr, png_info_ptr) == PNG_COLOR_TYPE_PALETTE) &&
++ (png_get_bit_depth(png_ptr, png_info_ptr) < 8))
+ png_set_packing (png_ptr);
+
+ tile_height = gimp_tile_height ();
+@@ -1065,7 +1067,7 @@ mng_save_image (const gchar *filename,
+ gimp_pixel_rgn_get_rect (&layer_pixel_rgn, layer_pixel, 0,
+ begin, layer_cols, num);
+
+- if ((png_info_ptr->valid & PNG_INFO_tRNS) == PNG_INFO_tRNS)
++ if (png_get_tRNS(png_ptr, png_info_ptr, &trans_alpha, &num_trans, &trans_color) != 0)
+ {
+ for (j = 0; j < num; j++)
+ {
+@@ -1077,7 +1079,7 @@ mng_save_image (const gchar *filename,
+ }
+ }
+ else
+- if (((png_info_ptr->valid & PNG_INFO_PLTE) == PNG_INFO_PLTE)
++ if ((png_get_PLTE(png_ptr, png_info_ptr, &palette, &num_palette) != 0)
+ && (layer_bpp == 2))
+ {
+ for (j = 0; j < num; j++)