Commits
Kurt Hindenburg authored 41eb1a85c85
1 - | http://pkgs.fedoraproject.org/cgit/htmldoc.git/plain/htmldoc-1.8.27-libpng15.patch?h=f18 |
2 - | From upstream 1.8 branch svn r1668 |
3 - | Index: htmldoc/image.cxx |
4 - | =================================================================== |
5 - | --- htmldoc/image.cxx.orig |
6 - | +++ htmldoc/image.cxx |
7 - | |
8 - | * |
9 - | * Image handling routines for HTMLDOC, a HTML document processing program. |
10 - | * |
11 - | - * Copyright 1997-2005 by Easy Software Products. |
12 - | + * Copyright 2011 by Michael R Sweet. |
13 - | + * Copyright 1997-2010 by Easy Software Products. All rights reserved. |
14 - | * |
15 - | - * These coded instructions, statements, and computer programs are the |
16 - | - * property of Easy Software Products and are protected by Federal |
17 - | - * copyright law. Distribution and use rights are outlined in the file |
18 - | - * "COPYING.txt" which should have been included with this file. If this |
19 - | - * file is missing or damaged please contact Easy Software Products |
20 - | - * at: |
21 - | - * |
22 - | - * Attn: ESP Licensing Information |
23 - | - * Easy Software Products |
24 - | - * 44141 Airport View Drive, Suite 204 |
25 - | - * Hollywood, Maryland 20636-3142 USA |
26 - | - * |
27 - | - * Voice: (301) 373-9600 |
28 - | - * EMail: info@easysw.com |
29 - | - * WWW: http://www.easysw.com |
30 - | + * This program is free software. Distribution and use rights are outlined in |
31 - | + * the file "COPYING.txt". |
32 - | * |
33 - | * Contents: |
34 - | * |
35 - | |
36 - | |
37 - | rows = NULL; |
38 - | |
39 - | - if (setjmp(pp->jmpbuf)) |
40 - | + if (setjmp(png_jmpbuf(pp))) |
41 - | { |
42 - | progress_error(HD_ERROR_BAD_FORMAT, "PNG file contains errors!"); |
43 - | |
44 - | |
45 - | |
46 - | png_read_info(pp, info); |
47 - | |
48 - | - if (info->color_type & PNG_COLOR_MASK_PALETTE) |
49 - | + if (png_get_color_type(pp, info) & PNG_COLOR_MASK_PALETTE) |
50 - | { |
51 - | png_set_expand(pp); |
52 - | |
53 - | |
54 - | if (Encryption) |
55 - | img->use ++; |
56 - | } |
57 - | - else if (info->bit_depth < 8) |
58 - | + else if (png_get_bit_depth(pp, info) < 8) |
59 - | { |
60 - | png_set_packing(pp); |
61 - | png_set_expand(pp); |
62 - | } |
63 - | - else if (info->bit_depth == 16) |
64 - | + else if (png_get_bit_depth(pp, info) == 16) |
65 - | png_set_strip_16(pp); |
66 - | |
67 - | - if (info->color_type & PNG_COLOR_MASK_COLOR) |
68 - | + if (png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR) |
69 - | { |
70 - | depth = 3; |
71 - | img->depth = gray ? 1 : 3; |
72 - | |
73 - | img->depth = 1; |
74 - | } |
75 - | |
76 - | - img->width = info->width; |
77 - | - img->height = info->height; |
78 - | + img->width = png_get_image_width(pp, info); |
79 - | + img->height = png_get_image_height(pp, info); |
80 - | |
81 - | - if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans) |
82 - | + if (png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA) |
83 - | { |
84 - | if ((PSLevel == 0 && PDFVersion >= 14) || PSLevel == 3) |
85 - | image_need_mask(img, 8); |
86 - | |
87 - | |
88 - | #ifdef DEBUG |
89 - | printf("color_type=0x%04x, depth=%d, img->width=%d, img->height=%d, img->depth=%d\n", |
90 - | - info->color_type, depth, img->width, img->height, img->depth); |
91 - | - if (info->color_type & PNG_COLOR_MASK_COLOR) |
92 - | + png_get_color_type(pp, info), depth, img->width, img->height, img->depth); |
93 - | + if (png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR) |
94 - | puts(" COLOR"); |
95 - | else |
96 - | puts(" GRAYSCALE"); |
97 - | - if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans) |
98 - | + if (png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA) |
99 - | puts(" ALPHA"); |
100 - | - if (info->color_type & PNG_COLOR_MASK_PALETTE) |
101 - | + if (png_get_color_type(pp, info) & PNG_COLOR_MASK_PALETTE) |
102 - | puts(" PALETTE"); |
103 - | #endif // DEBUG |
104 - | |
105 - | |
106 - | * Allocate pointers... |
107 - | */ |
108 - | |
109 - | - rows = (png_bytep *)calloc(info->height, sizeof(png_bytep)); |
110 - | + rows = (png_bytep *)calloc(png_get_image_height(pp, info), sizeof(png_bytep)); |
111 - | |
112 - | - for (i = 0; i < (int)info->height; i ++) |
113 - | + for (i = 0; i < (int)png_get_image_height(pp, info); i ++) |
114 - | rows[i] = img->pixels + i * img->width * depth; |
115 - | |
116 - | /* |
117 - | |
118 - | * Generate the alpha mask as necessary... |
119 - | */ |
120 - | |
121 - | - if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans) |
122 - | + if (png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA) |
123 - | { |
124 - | #ifdef DEBUG |
125 - | for (inptr = img->pixels, i = 0; i < img->height; i ++) |
126 - | |
127 - | * Reformat the data as necessary for the reader... |
128 - | */ |
129 - | |
130 - | - if (gray && info->color_type & PNG_COLOR_MASK_COLOR) |
131 - | + if (gray && png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR) |
132 - | { |
133 - | /* |
134 - | * Greyscale output needed... |
135 - | |
136 - | { |
137 - | // Alpha mask |
138 - | img->maskwidth = (img->width * scaling + 7) / 8; |
139 - | - size = img->maskwidth * img->height * scaling; |
140 - | + size = img->maskwidth * img->height * scaling + 1; |
141 - | } |
142 - | |
143 - | img->mask = (uchar *)calloc(size, 1); |