- fix build for png-1.4.1
This commit is contained in:
parent
563295c1c2
commit
4e520e0c13
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=251621
49
graphics/netpbm-devel/files/patch-pngtopnm.c
Normal file
49
graphics/netpbm-devel/files/patch-pngtopnm.c
Normal file
@ -0,0 +1,49 @@
|
||||
--- converter/other/pngtopnm.c.orig 2005-10-29 19:40:03.000000000 +0200
|
||||
+++ converter/other/pngtopnm.c 2010-03-28 12:40:36.000000000 +0200
|
||||
@@ -467,7 +467,7 @@
|
||||
bool retval;
|
||||
|
||||
if (info_ptr->valid & PNG_INFO_tRNS) {
|
||||
- const png_color_16 * const transColorP = &info_ptr->trans_values;
|
||||
+ const png_color_16 * const transColorP = &info_ptr->trans_color;
|
||||
|
||||
|
||||
/* There seems to be a problem here: you can't compare real
|
||||
@@ -558,8 +558,8 @@
|
||||
for (i = 0, foundGray = FALSE;
|
||||
i < info_ptr->num_trans && !foundGray;
|
||||
++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) {
|
||||
foundGray = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -630,7 +630,7 @@
|
||||
unsigned int i;
|
||||
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;
|
||||
}
|
||||
@@ -874,7 +874,7 @@
|
||||
setXel(&xelrow[col], fgColor, bgColor, alpha_handling,
|
||||
((info_ptr->valid & PNG_INFO_tRNS) &&
|
||||
(fgColor.r ==
|
||||
- gamma_correct(info_ptr->trans_values.gray,
|
||||
+ gamma_correct(info_ptr->trans_color.gray,
|
||||
totalgamma))) ?
|
||||
0 : maxval);
|
||||
}
|
||||
@@ -903,7 +903,7 @@
|
||||
setXel(&xelrow[col], fgColor, bgColor, alpha_handling,
|
||||
(info_ptr->valid & PNG_INFO_tRNS) &&
|
||||
index < info_ptr->num_trans ?
|
||||
- info_ptr->trans[index] : maxval);
|
||||
+ info_ptr->trans_alpha[index] : maxval);
|
||||
}
|
||||
break;
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- converter/other/pnmtopng.c.orig 2005-12-30 18:17:49.000000000 -0500
|
||||
+++ converter/other/pnmtopng.c 2005-12-30 18:18:15.000000000 -0500
|
||||
@@ -267,7 +267,7 @@ parseCommandLine (int argc, char ** argv
|
||||
--- converter/other/pnmtopng.c.orig 2005-10-16 21:36:43.000000000 +0200
|
||||
+++ converter/other/pnmtopng.c 2010-03-28 12:43:18.000000000 +0200
|
||||
@@ -267,7 +267,7 @@
|
||||
unsigned int option_def_index;
|
||||
|
||||
unsigned int alphaSpec, transparentSpec, backgroundSpec;
|
||||
@ -9,7 +9,7 @@
|
||||
unsigned int filterSpec;
|
||||
|
||||
unsigned int nofilter, sub, up, avg, paeth, filter;
|
||||
@@ -296,7 +296,7 @@ parseCommandLine (int argc, char ** argv
|
||||
@@ -296,7 +296,7 @@
|
||||
OPTENT3(0, "ztxt", OPT_STRING, &cmdlineP->ztxt,
|
||||
&ztxtSpec, 0);
|
||||
OPTENT3(0, "modtime", OPT_STRING, &modtime,
|
||||
@ -18,3 +18,36 @@
|
||||
OPTENT3(0, "palette", OPT_STRING, &cmdlineP->palette,
|
||||
&paletteSpec, 0);
|
||||
OPTENT3(0, "compression", OPT_UINT,
|
||||
@@ -2486,7 +2486,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 */
|
||||
@@ -2523,7 +2523,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 {
|
||||
@@ -2535,10 +2535,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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user