summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2011-04-19 10:28:31 +0000
committerwiz <wiz@pkgsrc.org>2011-04-19 10:28:31 +0000
commit39110be6c13c74a5272e66838c3b3e925092f7d4 (patch)
treef296aa6f6457bf4c8e255b21c1559688de4311e1
parentb663615162d4bf458eac97c908c4f758539dabd3 (diff)
downloadpkgsrc-39110be6c13c74a5272e66838c3b3e925092f7d4.tar.gz
Fix palette cases, after bug report from Gentoo.
Bump PKGREVISION.
-rw-r--r--graphics/gimp/Makefile4
-rw-r--r--graphics/gimp/distinfo6
-rw-r--r--graphics/gimp/patches/patch-ae53
-rw-r--r--graphics/gimp/patches/patch-af80
4 files changed, 81 insertions, 62 deletions
diff --git a/graphics/gimp/Makefile b/graphics/gimp/Makefile
index afb447bfd45..5295eb5372b 100644
--- a/graphics/gimp/Makefile
+++ b/graphics/gimp/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.204 2011/04/15 16:39:09 drochner Exp $
+# $NetBSD: Makefile,v 1.205 2011/04/19 10:28:31 wiz Exp $
DISTNAME= gimp-2.6.11
-PKGREVISION= 5
+PKGREVISION= 6
CATEGORIES= graphics
MASTER_SITES= ftp://ftp.gimp.org/pub/gimp/v2.6/ \
${MASTER_SITE_GNU:=gimp/v2.6/} \
diff --git a/graphics/gimp/distinfo b/graphics/gimp/distinfo
index 0d505a10553..ab40e78ff4b 100644
--- a/graphics/gimp/distinfo
+++ b/graphics/gimp/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.62 2011/04/15 16:39:09 drochner Exp $
+$NetBSD: distinfo,v 1.63 2011/04/19 10:28:31 wiz Exp $
SHA1 (gimp-2.6.11.tar.bz2) = 2f9d596e727bdbf304fa78257c1731d9faf3934c
RMD160 (gimp-2.6.11.tar.bz2) = a116377499e58dc2bfe231ab3c057d0be94091ff
@@ -7,8 +7,8 @@ SHA1 (patch-aa) = 0775c8037748bfc27eb610f3667ddaa92d710681
SHA1 (patch-ab) = 80e7235178e53e873efa0b16098b74fa0b981f76
SHA1 (patch-ac) = 42f44b45640bdde305c1e52b95ee633360ebccb8
SHA1 (patch-ad) = 4e2ce2f7d8729fb760eac1bad89cfe09fef499b0
-SHA1 (patch-ae) = 67aafb1b76925c239795c5dbda34ccb0f11dd6a8
-SHA1 (patch-af) = a8379ea6835ac1a44a1a933000cb92336377cf99
+SHA1 (patch-ae) = 5c39e6ff972c09f0c9005f2b7130e098e1368767
+SHA1 (patch-af) = 2926b5be1012295e9338940b5ff1d3b2c5d7619a
SHA1 (patch-ba) = 5efdceebadab408f2d4465eb1f7ef014c1cc064e
SHA1 (patch-bb) = c1ac683a55764c63f131a1d8c88f773638c7c66e
SHA1 (patch-bc) = afc862d6c79770f85a3c37353f6b77aae6726a43
diff --git a/graphics/gimp/patches/patch-ae b/graphics/gimp/patches/patch-ae
index e1418daf70e..7a3a3e98f33 100644
--- a/graphics/gimp/patches/patch-ae
+++ b/graphics/gimp/patches/patch-ae
@@ -1,4 +1,4 @@
-$NetBSD: patch-ae,v 1.12 2011/01/24 12:35:33 wiz Exp $
+$NetBSD: patch-ae,v 1.13 2011/04/19 10:28:31 wiz Exp $
Fix build with png-1.5.
https://bugzilla.gnome.org/show_bug.cgi?id=640409
@@ -28,7 +28,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=640409
{
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,
+@@ -981,37 +988,31 @@ mng_save_image (const gchar *filename,
png_init_io (png_ptr, outfile);
png_set_compression_level (png_ptr, mng_data.compression_level);
@@ -37,6 +37,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=640409
- png_info_ptr->interlace_type = (mng_data.interlaced == 0 ? 0 : 1);
- png_info_ptr->bit_depth = 8;
-
++ bit_depth = 8;
switch (layer_drawable_type)
{
case GIMP_RGB_IMAGE:
@@ -61,42 +62,48 @@ https://bugzilla.gnome.org/show_bug.cgi?id=640409
- 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;
+- break;
case GIMP_INDEXEDA_IMAGE:
- png_info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
+- layer_has_unique_palette =
+- respin_cmap (png_ptr, png_info_ptr, layer_remap,
+- image_id, layer_drawable);
+ 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,
++ gimp_image_get_colormap (image_id, &num_colors);
++ if (num_palette <= 2)
++ bit_depth = 1;
++ else if (num_palette <= 4)
++ bit_depth = 2;
++ else if (num_palette <= 16)
++ bit_depth = 4;
+ break;
+ default:
+ g_warning ("This can't be!\n");
+@@ -1021,16 +1022,14 @@ 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);
++ if (layer_drawable_type == GIMP_INDEXED_IMAGE)
++ png_set_PLTE(png_ptr, png_info_ptr, (png_colorp) gimp_image_get_colormap (image_id, &num_colors), num_colors);
++ else if (layer_drawable_type == GIMP_INDEXEDA_IMAGE)
++ layer_has_unique_palette =
++ respin_cmap (png_ptr, png_info_ptr, layer_remap,
++ image_id, layer_drawable);
png_write_info (png_ptr, png_info_ptr);
-@@ -1038,8 +1040,8 @@ mng_save_image (const gchar *filename,
+ if (mng_data.interlaced != 0)
+@@ -1038,8 +1037,8 @@ mng_save_image (const gchar *filename,
else
num_passes = 1;
@@ -107,7 +114,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=640409
png_set_packing (png_ptr);
tile_height = gimp_tile_height ();
-@@ -1065,7 +1067,7 @@ mng_save_image (const gchar *filename,
+@@ -1065,7 +1064,7 @@ mng_save_image (const gchar *filename,
gimp_pixel_rgn_get_rect (&layer_pixel_rgn, layer_pixel, 0,
begin, layer_cols, num);
@@ -116,7 +123,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=640409
{
for (j = 0; j < num; j++)
{
-@@ -1077,7 +1079,7 @@ mng_save_image (const gchar *filename,
+@@ -1077,7 +1076,7 @@ mng_save_image (const gchar *filename,
}
}
else
diff --git a/graphics/gimp/patches/patch-af b/graphics/gimp/patches/patch-af
index 383877ded59..10e0dabfb34 100644
--- a/graphics/gimp/patches/patch-af
+++ b/graphics/gimp/patches/patch-af
@@ -1,4 +1,4 @@
-$NetBSD: patch-af,v 1.7 2011/01/24 16:51:59 wiz Exp $
+$NetBSD: patch-af,v 1.8 2011/04/19 10:28:31 wiz Exp $
Fix build with png-1.5.
https://bugzilla.gnome.org/show_bug.cgi?id=640409
@@ -237,7 +237,15 @@ https://bugzilla.gnome.org/show_bug.cgi?id=640409
/*
* Initialise remap[]
*/
-@@ -1309,37 +1317,34 @@ save_image (const gchar *filename,
+@@ -1304,44 +1312,48 @@ save_image (const gchar *filename,
+
+ /*
+ * Set color type and remember bytes per pixel count
++ * Also fix bit depths for (possibly) smaller colormap images
+ */
+
++ bit_depth = 8;
++
switch (type)
{
case GIMP_RGB_IMAGE:
@@ -265,31 +273,47 @@ https://bugzilla.gnome.org/show_bug.cgi?id=640409
break;
case GIMP_INDEXED_IMAGE:
++ case GIMP_INDEXEDA_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;
+- break;
++ if (type == GIMP_INDEXEDA_IMAGE)
++ bpp = 2;
- case GIMP_INDEXEDA_IMAGE:
- bpp = 2;
+- case GIMP_INDEXEDA_IMAGE:
+- bpp = 2;
- info->color_type = PNG_COLOR_TYPE_PALETTE;
+- /* fix up transparency */
+- respin_cmap (pp, info, remap, image_ID, drawable);
+ color_type = PNG_COLOR_TYPE_PALETTE;
- /* fix up transparency */
- respin_cmap (pp, info, remap, image_ID, drawable);
++ gimp_image_get_colormap (image_ID, &num_colors);
++ if (num_colors <= 2)
++ bit_depth = 1;
++ else if (num_colors <= 4)
++ bit_depth = 2;
++ else if (num_colors <= 16)
++ bit_depth = 4;
++ /* otherwise the default is fine */
break;
-@@ -1353,17 +1358,25 @@ save_image (const gchar *filename,
- * Fix bit depths for (possibly) smaller colormap images
- */
+
+ default:
+@@ -1349,19 +1361,14 @@ save_image (const gchar *filename,
+ return FALSE;
+ }
+
+- /*
+- * Fix bit depths for (possibly) smaller colormap images
+- */
++ png_set_IHDR(pp, info, drawable->width, drawable->height, bit_depth, color_type, pngvals.interlaced ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
- if (info->valid & PNG_INFO_PLTE)
-+ bit_depth = 8;
-+
-+ if (png_get_valid(pp, info, PNG_INFO_PLTE))
++ if (type == GIMP_INDEXED_IMAGE)
++ png_set_PLTE(pp, info, (png_colorp) gimp_image_get_colormap (image_ID, &num_colors), num_colors);
++ else if (type == GIMP_INDEXEDA_IMAGE)
{
- if (info->num_palette <= 2)
- info->bit_depth = 1;
@@ -297,25 +321,13 @@ https://bugzilla.gnome.org/show_bug.cgi?id=640409
- 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 */
+- /* otherwise the default is fine */
++ /* fix up transparency */
++ respin_cmap (pp, info, remap, image_ID, drawable);
}
-+ png_set_IHDR(pp, info, drawable->width, drawable->height, bit_depth, color_type, pngvals.interlaced ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
-+
/* 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,
+@@ -1477,7 +1484,7 @@ save_image (const gchar *filename,
* Convert unpacked pixels to packed if necessary
*/
@@ -324,7 +336,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=640409
png_set_packing (pp);
/*
-@@ -1529,7 +1542,7 @@ save_image (const gchar *filename,
+@@ -1529,7 +1536,7 @@ save_image (const gchar *filename,
/* If we're dealing with a paletted image with
* transparency set, write out the remapped palette */
@@ -333,7 +345,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=640409
{
guchar inverse_remap[256];
-@@ -1549,7 +1562,7 @@ save_image (const gchar *filename,
+@@ -1549,7 +1556,7 @@ save_image (const gchar *filename,
}
/* Otherwise if we have a paletted image and transparency
* couldn't be set, we ignore the alpha channel */
@@ -342,7 +354,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=640409
{
for (i = 0; i < num; ++i)
{
-@@ -1564,7 +1577,7 @@ save_image (const gchar *filename,
+@@ -1564,7 +1571,7 @@ save_image (const gchar *filename,
png_write_rows (pp, pixels, num);
gimp_progress_update (((double) pass + (double) end /