From e6ac9d7aba061c5b5cc253c704323876846d3016 Mon Sep 17 00:00:00 2001 From: dinoex Date: Sun, 28 Mar 2010 18:22:49 +0000 Subject: - fix build for png-1.4.1 PR: 145111 --- graphics/GraphicsMagick/Makefile | 5 +- graphics/GraphicsMagick/files/patch-coders__png.c | 206 +++++++++++++++++++++ .../GraphicsMagick/files/patch-magick__locale_c.h | 11 ++ 3 files changed, 220 insertions(+), 2 deletions(-) create mode 100644 graphics/GraphicsMagick/files/patch-coders__png.c create mode 100644 graphics/GraphicsMagick/files/patch-magick__locale_c.h (limited to 'graphics/GraphicsMagick') diff --git a/graphics/GraphicsMagick/Makefile b/graphics/GraphicsMagick/Makefile index efb29b8a4155..910b5fd3befc 100644 --- a/graphics/GraphicsMagick/Makefile +++ b/graphics/GraphicsMagick/Makefile @@ -55,8 +55,9 @@ USE_LDCONFIG= yes ALL_TARGET= -j`${SYSCTL} -n hw.ncpu` -CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include" \ - LDFLAGS="-L${LOCALBASE}/lib" +CFLAGS+= -DPNG_DEPSTRUCT= +CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \ + LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib" test check: cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} check diff --git a/graphics/GraphicsMagick/files/patch-coders__png.c b/graphics/GraphicsMagick/files/patch-coders__png.c new file mode 100644 index 000000000000..49c65302d833 --- /dev/null +++ b/graphics/GraphicsMagick/files/patch-coders__png.c @@ -0,0 +1,206 @@ +--- coders/png.c.orig 2008-01-18 00:34:17.000000000 +0100 ++++ coders/png.c 2010-03-28 19:51:04.000000000 +0200 +@@ -2038,10 +2038,10 @@ + /* + Image has a transparent background. + */ +- transparent_color.red=(int) (ping_info->trans_values.red*scale); +- transparent_color.green=(int) (ping_info->trans_values.green*scale); +- transparent_color.blue=(int) (ping_info->trans_values.blue*scale); +- transparent_color.opacity=(int) (ping_info->trans_values.gray*scale); ++ transparent_color.red=(int) (ping_info->trans_color.red*scale); ++ transparent_color.green=(int) (ping_info->trans_color.green*scale); ++ transparent_color.blue=(int) (ping_info->trans_color.blue*scale); ++ transparent_color.opacity=(int) (ping_info->trans_color.gray*scale); + if (ping_info->color_type == PNG_COLOR_TYPE_GRAY) + { + transparent_color.red=transparent_color.opacity; +@@ -2547,7 +2547,7 @@ + index=indexes[x]; + if (index < ping_info->num_trans) + q->opacity= +- ScaleCharToQuantum(255-ping_info->trans[index]); ++ ScaleCharToQuantum(255-ping_info->trans_alpha[index]); + q++; + } + else if (ping_info->color_type == PNG_COLOR_TYPE_GRAY) +@@ -6229,12 +6229,12 @@ + /* + Identify which colormap entry is transparent. + */ +- ping_info->trans=MagickAllocateMemory(unsigned char *,number_colors); +- if (ping_info->trans == (unsigned char *) NULL) ++ ping_info->trans_alpha=MagickAllocateMemory(unsigned char *,number_colors); ++ if (ping_info->trans_alpha == (unsigned char *) NULL) + ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); + assert(number_colors <= 256); + for (i=0; i < (long) number_colors; i++) +- ping_info->trans[i]=255; ++ ping_info->trans_alpha[i]=255; + for (y=0; y < (long) image->rows; y++) + { + register const PixelPacket +@@ -6254,7 +6254,7 @@ + + index=indexes[x]; + assert((unsigned long) index < number_colors); +- ping_info->trans[index]=(png_byte) (255- ++ ping_info->trans_alpha[index]=(png_byte) (255- + ScaleQuantumToChar(p->opacity)); + } + p++; +@@ -6262,14 +6262,14 @@ + } + ping_info->num_trans=0; + for (i=0; i < (long) number_colors; i++) +- if (ping_info->trans[i] != 255) ++ if (ping_info->trans_alpha[i] != 255) + ping_info->num_trans=(unsigned short) (i+1); + if (ping_info->num_trans == 0) + ping_info->valid&=(~PNG_INFO_tRNS); + if (!(ping_info->valid & PNG_INFO_tRNS)) + ping_info->num_trans=0; + if (ping_info->num_trans == 0) +- MagickFreeMemory(ping_info->trans); ++ MagickFreeMemory(ping_info->trans_alpha); + /* + Identify which colormap entry is the background color. + */ +@@ -6388,12 +6388,12 @@ + if (ping_info->bit_depth == 1) + mask=0x0001; + ping_info->valid|=PNG_INFO_tRNS; +- ping_info->trans_values.red=ScaleQuantumToShort(p->red)&mask; +- ping_info->trans_values.green=ScaleQuantumToShort(p->green)&mask; +- ping_info->trans_values.blue=ScaleQuantumToShort(p->blue)&mask; +- ping_info->trans_values.gray= ++ ping_info->trans_color.red=ScaleQuantumToShort(p->red)&mask; ++ ping_info->trans_color.green=ScaleQuantumToShort(p->green)&mask; ++ ping_info->trans_color.blue=ScaleQuantumToShort(p->blue)&mask; ++ ping_info->trans_color.gray= + (png_uint_16) ScaleQuantumToShort(PixelIntensity(p))&mask; +- ping_info->trans_values.index=(unsigned char) ++ ping_info->trans_color.index=(unsigned char) + (ScaleQuantumToChar(MaxRGB-p->opacity)); + } + if (ping_info->valid & PNG_INFO_tRNS) +@@ -6413,7 +6413,7 @@ + { + if (p->opacity != OpaqueOpacity) + { +- if (!RGBColorMatchExact(ping_info->trans_values,*p)) ++ if (!RGBColorMatchExact(ping_info->trans_color,*p)) + { + break; /* Can't use RGB + tRNS for multiple + transparent colors. */ +@@ -6426,7 +6426,7 @@ + } + else + { +- if (RGBColorMatchExact(ping_info->trans_values,*p)) ++ if (RGBColorMatchExact(ping_info->trans_color,*p)) + break; /* Can't use RGB + tRNS when another pixel + having the same RGB samples is + transparent. */ +@@ -6444,10 +6444,10 @@ + ping_info->color_type &= 0x03; /* changes 4 or 6 to 0 or 2 */ + if (image->depth == 8) + { +- ping_info->trans_values.red&=0xff; +- ping_info->trans_values.green&=0xff; +- ping_info->trans_values.blue&=0xff; +- ping_info->trans_values.gray&=0xff; ++ ping_info->trans_color.red&=0xff; ++ ping_info->trans_color.green&=0xff; ++ ping_info->trans_color.blue&=0xff; ++ ping_info->trans_color.gray&=0xff; + } + } + } +@@ -6463,7 +6463,7 @@ + { + ping_info->color_type=PNG_COLOR_TYPE_GRAY; + if (save_image_depth == 16 && image->depth == 8) +- ping_info->trans_values.gray*=0x0101; ++ ping_info->trans_color.gray*=0x0101; + } + if (image->depth > QuantumDepth) + image->depth=QuantumDepth; +@@ -6577,14 +6577,14 @@ + /* + Identify which colormap entry is transparent. + */ +- ping_info->trans=MagickAllocateMemory(unsigned char *, ++ ping_info->trans_alpha=MagickAllocateMemory(unsigned char *, + number_colors); +- if (ping_info->trans == (unsigned char *) NULL) ++ if (ping_info->trans_alpha == (unsigned char *) NULL) + ThrowWriterException(ResourceLimitError, + MemoryAllocationFailed,image); + assert(number_colors <= 256); + for (i=0; i < (long) number_colors; i++) +- ping_info->trans[i]=255; ++ ping_info->trans_alpha[i]=255; + for (y=0; y < (long) image->rows; y++) + { + register const PixelPacket +@@ -6604,21 +6604,21 @@ + + index=indexes[x]; + assert((unsigned long) index < number_colors); +- ping_info->trans[index]=(png_byte) (255- ++ ping_info->trans_alpha[index]=(png_byte) (255- + ScaleQuantumToChar(p->opacity)); + } + p++; + } + } + for (i=0; i < (long) number_colors; i++) +- if (ping_info->trans[i] != 255) ++ if (ping_info->trans_alpha[i] != 255) + ping_info->num_trans=(unsigned short) (i+1); + if (ping_info->num_trans == 0) + ping_info->valid&=(~PNG_INFO_tRNS); + if (!(ping_info->valid & PNG_INFO_tRNS)) + ping_info->num_trans=0; + if (ping_info->num_trans == 0) +- MagickFreeMemory(ping_info->trans); ++ MagickFreeMemory(ping_info->trans_alpha); + } + + /* +@@ -6636,10 +6636,10 @@ + image->depth=8; + if ((save_image_depth == 16) && (image->depth == 8)) + { +- ping_info->trans_values.red*=0x0101; +- ping_info->trans_values.green*=0x0101; +- ping_info->trans_values.blue*=0x0101; +- ping_info->trans_values.gray*=0x0101; ++ ping_info->trans_color.red*=0x0101; ++ ping_info->trans_color.green*=0x0101; ++ ping_info->trans_color.blue*=0x0101; ++ ping_info->trans_color.gray*=0x0101; + } + } + +@@ -6666,8 +6666,8 @@ + " Setting up bKGD chunk"); + png_set_bKGD(ping,ping_info,&background); + +- ping_info->trans_values.gray=(png_uint_16)(maxval* +- ping_info->trans_values.gray/MaxRGB); ++ ping_info->trans_color.gray=(png_uint_16)(maxval* ++ ping_info->trans_color.gray/MaxRGB); + } + } + if (logging) +@@ -7174,7 +7174,7 @@ + #endif + if (ping_info->valid & PNG_INFO_tRNS) + { +- MagickFreeMemory(ping_info->trans); ++ MagickFreeMemory(ping_info->trans_alpha); + ping_info->valid&=(~PNG_INFO_tRNS); + } + png_destroy_write_struct(&ping,&ping_info); diff --git a/graphics/GraphicsMagick/files/patch-magick__locale_c.h b/graphics/GraphicsMagick/files/patch-magick__locale_c.h new file mode 100644 index 000000000000..20e8e213b1b7 --- /dev/null +++ b/graphics/GraphicsMagick/files/patch-magick__locale_c.h @@ -0,0 +1,11 @@ +--- magick/locale_c.h.orig 2004-07-06 02:06:31.000000000 +0200 ++++ magick/locale_c.h 2010-03-28 20:13:08.000000000 +0200 +@@ -251,7 +251,7 @@ + #define MGK_OptionErrorStereoImageRequired 244 + #define MGK_OptionErrorSubimageSpecificationReturnsNoImages 245 + #define MGK_OptionErrorUnableToAddOrRemoveProfile 246 +-#define MGK_OptionErrorUnableToAllocateICCProfile 247 ++#define MGK_ResourceLimitErrorUnableToAllocateICCProfile 247 + #define MGK_OptionErrorUnableToAverageImageSequence 248 + #define MGK_OptionErrorUnableToBlurImage 249 + #define MGK_OptionErrorUnableToChopImage 250 -- cgit