libpng 1.4+ compatibility --- wv/magick/png.c.orig 2000-12-08 00:35:29.000000000 -0600 +++ wv/magick/png.c 2011-11-20 18:01:26.000000000 -0600 @@ -2015,10 +2015,10 @@ /* Image has a transparent background. */ - transparent_color.red=ping_info->trans_values.red; - transparent_color.green=ping_info->trans_values.green; - transparent_color.blue=ping_info->trans_values.blue; - transparent_color.index=ping_info->trans_values.gray; + transparent_color.red=ping_info->trans_color.red; + transparent_color.green=ping_info->trans_color.green; + transparent_color.blue=ping_info->trans_color.blue; + transparent_color.index=ping_info->trans_color.gray; if (ping_info->color_type == PNG_COLOR_TYPE_GRAY) { transparent_color.red=transparent_color.index; @@ -2029,9 +2029,9 @@ { printf("transparent color = %5d %5d %5d (tRNS = %5d %5d %5d %5d)\n", transparent_color.red,transparent_color.green, - transparent_color.blue,ping_info->trans_values.red, - ping_info->trans_values.green,ping_info->trans_values.blue, - ping_info->trans_values.index); + transparent_color.blue,ping_info->trans_color.red, + ping_info->trans_color.green,ping_info->trans_color.blue, + ping_info->trans_color.index); if (ping_info->color_type == PNG_COLOR_TYPE_GRAY) printf("transparent color index= %5d\n",transparent_color.index); } @@ -2391,7 +2391,7 @@ if (ping_info->color_type == PNG_COLOR_TYPE_PALETTE) { if (index < ping_info->num_trans) - q->index=(unsigned short)UpScale(ping_info->trans[index]); + q->index=(unsigned short)UpScale(ping_info->trans_alpha[index]); } else { @@ -3646,11 +3646,11 @@ if (p->index != Opaque) { ping_info->valid|=PNG_INFO_tRNS; - ping_info->trans_values.red=p->red; - ping_info->trans_values.green=p->green; - ping_info->trans_values.blue=p->blue; - ping_info->trans_values.gray=(unsigned short) Intensity(*p); - ping_info->trans_values.index=(unsigned short) DownScale(p->index); + ping_info->trans_color.red=p->red; + ping_info->trans_color.green=p->green; + ping_info->trans_color.blue=p->blue; + ping_info->trans_color.gray=(unsigned short) Intensity(*p); + ping_info->trans_color.index=(unsigned short) DownScale(p->index); } else { @@ -3673,7 +3673,7 @@ { if (p->index != Opaque) { - if (!ColorMatch(ping_info->trans_values,*p,0)) + if (!ColorMatch(ping_info->trans_color,*p,0)) { ping_info->valid&=(~PNG_INFO_tRNS); if (image_info->verbose) @@ -3689,7 +3689,7 @@ } else { - if (ColorMatch(ping_info->trans_values,*p,0)) + if (ColorMatch(ping_info->trans_color,*p,0)) { /* Can't use RGB + tRNS */ ping_info->valid&=(~PNG_INFO_tRNS); @@ -3708,11 +3708,11 @@ if (save_image_depth == 16 && image->depth == 8) { if(image_info->verbose) - printf("reducing trans_values to 8-bit\n"); - ping_info->trans_values.red&=0xff; - ping_info->trans_values.green&=0xff; - ping_info->trans_values.blue&=0xff; - ping_info->trans_values.gray&=0xff; + printf("reducing trans_color to 8-bit\n"); + ping_info->trans_color.red&=0xff; + ping_info->trans_color.green&=0xff; + ping_info->trans_color.blue&=0xff; + ping_info->trans_color.gray&=0xff; } } } @@ -3763,28 +3763,28 @@ if (save_image_depth == 16 && image->depth == 8) { if(image_info->verbose) - printf("re-expanding trans_values to 16-bit\n"); - ping_info->trans_values.red*=0x0101; - ping_info->trans_values.green*=0x0101; - ping_info->trans_values.blue*=0x0101; - ping_info->trans_values.gray*=0x0101; + printf("re-expanding trans_color to 16-bit\n"); + ping_info->trans_color.red*=0x0101; + ping_info->trans_color.green*=0x0101; + ping_info->trans_color.blue*=0x0101; + ping_info->trans_color.gray*=0x0101; } /* Identify which colormap entry is transparent. */ if (image_info->verbose) printf("Allocating memory for trans\n"); - ping_info->trans=(unsigned char *) + ping_info->trans_alpha=(unsigned char *) AllocateMemory(image->colors*sizeof(unsigned char)); - if (ping_info->trans == (unsigned char *) NULL) + if (ping_info->trans_alpha == (unsigned char *) NULL) WriterExit(ResourceLimitWarning,"Memory allocation failed", image); for (i=0; i < (int) image->colors; i++) { - ping_info->trans[i]=DownScale(Opaque); - if (ColorMatch(ping_info->trans_values,image->colormap[i],0)) + ping_info->trans_alpha[i]=DownScale(Opaque); + if (ColorMatch(ping_info->trans_color,image->colormap[i],0)) { - ping_info->trans[i]=ping_info->trans_values.index; + ping_info->trans_alpha[i]=ping_info->trans_color.index; break; } }