summaryrefslogtreecommitdiff
path: root/graphics/netpbm/patches/patch-af
blob: 0e9969ce69a32a4b1b7e2afed9446f1255bd6324 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
$NetBSD: patch-af,v 1.14 2010/06/13 22:44:39 wiz Exp $

--- converter/other/pngtopnm.c.orig	2009-09-03 15:34:36.000000000 +0000
+++ converter/other/pngtopnm.c
@@ -44,12 +44,6 @@
 #include "nstring.h"
 #include "shhopt.h"
 
-#if PNG_LIBPNG_VER >= 10400
-#error Your PNG library (<png.h>) is incompatible with this Netpbm source code.
-#error You need either an older PNG library (older than 1.4)
-#error newer Netpbm source code (at least 10.48)
-#endif
-
 typedef struct _jmpbuf_wrapper {
   jmp_buf jmpbuf;
 } jmpbuf_wrapper;
@@ -482,7 +476,7 @@ isTransparentColor(pngcolor   const colo
     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
@@ -575,8 +569,8 @@ paletteHasPartialTransparency(png_info *
             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;
                 }
             }
@@ -647,7 +641,7 @@ setupSignificantBits(png_struct *       
                 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;
                     }
@@ -885,7 +879,7 @@ writePnm(FILE *              const ofP,
                 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);
             }
@@ -914,7 +908,7 @@ writePnm(FILE *              const ofP,
                 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;