- fix build for png-1.4.1

This commit is contained in:
Dirk Meyer 2010-03-28 10:29:44 +00:00
parent fc7ba69e91
commit 198e864f7e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=251619
3 changed files with 89 additions and 0 deletions

View file

@ -31,6 +31,7 @@ CONFLICTS= mgetty-1.*
USE_PERL5= yes
USE_GMAKE= yes
CFLAGS+= -DPNG_DEPSTRUCT=
MAKE_ENV= LN="${LN}" RANLIB="${RANLIB}"
MAKEFILE= GNUmakefile
INSTALL_TARGET= install.bin install.lib install.data install-dev

View file

@ -0,0 +1,53 @@
--- converter/other/pngtopnm.c.orig 2004-04-04 02:18:34.000000000 +0200
+++ converter/other/pngtopnm.c 2010-03-28 12:29:26.000000000 +0200
@@ -494,7 +494,7 @@
case PNG_COLOR_TYPE_GRAY:
setXel(&xelrow[col], c, c, c,
((info_ptr->valid & PNG_INFO_tRNS) &&
- (c == gamma_correct(info_ptr->trans_values.gray,
+ (c == gamma_correct(info_ptr->trans_color.gray,
totalgamma))) ?
0 : maxval);
break;
@@ -511,7 +511,7 @@
info_ptr->palette[c].blue,
(info_ptr->valid & PNG_INFO_tRNS) &&
c < info_ptr->num_trans ?
- info_ptr->trans[c] : maxval);
+ info_ptr->trans_alpha[c] : maxval);
break;
case PNG_COLOR_TYPE_RGB: {
@@ -519,11 +519,11 @@
png_uint_16 const c3 = get_png_val(png_pixelP);
setXel(&xelrow[col], c, c2, c3,
((info_ptr->valid & PNG_INFO_tRNS) &&
- (c == gamma_correct(info_ptr->trans_values.red,
+ (c == gamma_correct(info_ptr->trans_color.red,
totalgamma)) &&
- (c2 == gamma_correct(info_ptr->trans_values.green,
+ (c2 == gamma_correct(info_ptr->trans_color.green,
totalgamma)) &&
- (c3 == gamma_correct(info_ptr->trans_values.blue,
+ (c3 == gamma_correct(info_ptr->trans_color.blue,
totalgamma))) ?
0 : maxval);
}
@@ -688,7 +688,7 @@
(info_ptr->valid & PNG_INFO_tRNS)) {
trans_mix = TRUE;
for (i = 0 ; i < info_ptr->num_trans ; i++)
- if (info_ptr->trans[i] != 0 && info_ptr->trans[i] != 255) {
+ if (info_ptr->trans_alpha[i] != 0 && info_ptr->trans_alpha[i] != 255) {
trans_mix = FALSE;
break;
}
@@ -841,7 +841,7 @@
pnm_type = PBM_TYPE;
if (info_ptr->valid & PNG_INFO_tRNS) {
for (i = 0 ; i < info_ptr->num_trans ; i++) {
- if (info_ptr->trans[i] != 0 && info_ptr->trans[i] != maxval) {
+ if (info_ptr->trans_alpha[i] != 0 && info_ptr->trans_alpha[i] != maxval) {
pnm_type = PGM_TYPE;
break;
}

View file

@ -0,0 +1,35 @@
--- converter/other/pnmtopng.c.orig 2007-07-04 05:26:21.000000000 +0200
+++ converter/other/pnmtopng.c 2010-03-28 12:17:40.000000000 +0200
@@ -1863,7 +1863,7 @@
info_ptr->num_palette = palette_size;
if (trans_size > 0) {
info_ptr->valid |= PNG_INFO_tRNS;
- info_ptr->trans = trans;
+ info_ptr->trans_alpha = trans;
info_ptr->num_trans = trans_size; /* omit opaque values */
}
/* creating hIST chunk */
@@ -1900,7 +1900,7 @@
info_ptr->color_type == PNG_COLOR_TYPE_RGB) {
if (transparent > 0) {
info_ptr->valid |= PNG_INFO_tRNS;
- info_ptr->trans_values =
+ info_ptr->trans_color =
xelToPngColor_16(transcolor, maxval, png_maxval);
}
} else {
@@ -1912,10 +1912,10 @@
if (info_ptr->valid && PNG_INFO_tRNS)
pm_message("Transparent color {gray, red, green, blue} = "
"{%d, %d, %d, %d}",
- info_ptr->trans_values.gray,
- info_ptr->trans_values.red,
- info_ptr->trans_values.green,
- info_ptr->trans_values.blue);
+ info_ptr->trans_color.gray,
+ info_ptr->trans_color.red,
+ info_ptr->trans_color.green,
+ info_ptr->trans_color.blue);
else
pm_message("No transparent color");
}