1 |
commit: 3edea8b85c390e2bee187d009c834eda9d46ac3a |
2 |
Author: Michael Mair-Keimberger (asterix) <m.mairkeimberger <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Dec 23 16:08:13 2016 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 29 13:11:45 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3edea8b8 |
7 |
|
8 |
media-libs/libharu: remove unused patch |
9 |
|
10 |
Closes: https://github.com/gentoo/gentoo/pull/3224 |
11 |
|
12 |
.../libharu/files/libharu-2.2.1-libpng-1.5.patch | 344 --------------------- |
13 |
1 file changed, 344 deletions(-) |
14 |
|
15 |
diff --git a/media-libs/libharu/files/libharu-2.2.1-libpng-1.5.patch b/media-libs/libharu/files/libharu-2.2.1-libpng-1.5.patch |
16 |
deleted file mode 100644 |
17 |
index d59f78f..00000000 |
18 |
--- a/media-libs/libharu/files/libharu-2.2.1-libpng-1.5.patch |
19 |
+++ /dev/null |
20 |
@@ -1,344 +0,0 @@ |
21 |
-diff --git a/src/hpdf_image_png.c b/src/hpdf_image_png.c |
22 |
-index b8f831e..85bd29f 100644 |
23 |
---- a/src/hpdf_image_png.c |
24 |
-+++ b/src/hpdf_image_png.c |
25 |
-@@ -109,14 +109,15 @@ ReadPngData_Interlaced (HPDF_Dict image, |
26 |
- png_infop info_ptr) |
27 |
- { |
28 |
- png_uint_32 len = png_get_rowbytes(png_ptr, info_ptr); |
29 |
-+ png_uint_32 height = png_get_image_height(png_ptr, info_ptr); |
30 |
- png_bytep* row_pointers = HPDF_GetMem (image->mmgr, |
31 |
-- info_ptr->height * sizeof (png_bytep)); |
32 |
-+ height * sizeof (png_bytep)); |
33 |
- |
34 |
- if (row_pointers) { |
35 |
- HPDF_UINT i; |
36 |
- |
37 |
-- HPDF_MemSet (row_pointers, 0, info_ptr->height * sizeof (png_bytep)); |
38 |
-- for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) { |
39 |
-+ HPDF_MemSet (row_pointers, 0, height * sizeof (png_bytep)); |
40 |
-+ for (i = 0; i < (HPDF_UINT)height; i++) { |
41 |
- row_pointers[i] = HPDF_GetMem (image->mmgr, len); |
42 |
- |
43 |
- if (image->error->error_no != HPDF_OK) |
44 |
-@@ -126,7 +127,7 @@ ReadPngData_Interlaced (HPDF_Dict image, |
45 |
- if (image->error->error_no == HPDF_OK) { |
46 |
- png_read_image(png_ptr, row_pointers); |
47 |
- if (image->error->error_no == HPDF_OK) { /* add this line */ |
48 |
-- for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) { |
49 |
-+ for (i = 0; i < (HPDF_UINT)height; i++) { |
50 |
- if (HPDF_Stream_Write (image->stream, row_pointers[i], len) != |
51 |
- HPDF_OK) |
52 |
- break; |
53 |
-@@ -135,7 +136,7 @@ ReadPngData_Interlaced (HPDF_Dict image, |
54 |
- } |
55 |
- |
56 |
- /* clean up */ |
57 |
-- for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) { |
58 |
-+ for (i = 0; i < (HPDF_UINT)height; i++) { |
59 |
- HPDF_FreeMem (image->mmgr, row_pointers[i]); |
60 |
- } |
61 |
- |
62 |
-@@ -151,12 +152,13 @@ ReadPngData (HPDF_Dict image, |
63 |
- png_infop info_ptr) |
64 |
- { |
65 |
- png_uint_32 len = png_get_rowbytes(png_ptr, info_ptr); |
66 |
-+ png_uint_32 height = png_get_image_height(png_ptr, info_ptr); |
67 |
- png_bytep buf_ptr = HPDF_GetMem (image->mmgr, len); |
68 |
- |
69 |
- if (buf_ptr) { |
70 |
- HPDF_UINT i; |
71 |
- |
72 |
-- for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) { |
73 |
-+ for (i = 0; i < (HPDF_UINT)height; i++) { |
74 |
- png_read_rows(png_ptr, (png_byte**)&buf_ptr, NULL, 1); |
75 |
- if (image->error->error_no != HPDF_OK) |
76 |
- break; |
77 |
-@@ -182,17 +184,19 @@ ReadTransparentPaletteData (HPDF_Dict image, |
78 |
- HPDF_STATUS ret = HPDF_OK; |
79 |
- HPDF_UINT i, j; |
80 |
- png_bytep *row_ptr; |
81 |
-+ png_uint_32 height = png_get_image_height(png_ptr, info_ptr); |
82 |
-+ png_uint_32 width = png_get_image_width(png_ptr, info_ptr); |
83 |
- |
84 |
-- row_ptr = HPDF_GetMem (image->mmgr, info_ptr->height * sizeof(png_bytep)); |
85 |
-+ row_ptr = HPDF_GetMem (image->mmgr, height * sizeof(png_bytep)); |
86 |
- if (!row_ptr) { |
87 |
- return HPDF_FAILD_TO_ALLOC_MEM; |
88 |
- } else { |
89 |
- png_uint_32 len = png_get_rowbytes(png_ptr, info_ptr); |
90 |
- |
91 |
-- for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) { |
92 |
-+ for (i = 0; i < (HPDF_UINT)height; i++) { |
93 |
- row_ptr[i] = HPDF_GetMem(image->mmgr, len); |
94 |
- if (!row_ptr[i]) { |
95 |
-- for (; i >= 0; i--) { |
96 |
-+ for (; i > 0; i--) { |
97 |
- HPDF_FreeMem (image->mmgr, row_ptr[i]); |
98 |
- } |
99 |
- HPDF_FreeMem (image->mmgr, row_ptr); |
100 |
-@@ -207,19 +211,19 @@ ReadTransparentPaletteData (HPDF_Dict image, |
101 |
- goto Error; |
102 |
- } |
103 |
- |
104 |
-- for (j = 0; j < info_ptr->height; j++) { |
105 |
-- for (i = 0; i < info_ptr->width; i++) { |
106 |
-- smask_data[info_ptr->width * j + i] = (row_ptr[j][i] < num_trans) ? trans[row_ptr[j][i]] : 0xFF; |
107 |
-+ for (j = 0; j < height; j++) { |
108 |
-+ for (i = 0; i < width; i++) { |
109 |
-+ smask_data[width * j + i] = (row_ptr[j][i] < num_trans) ? trans[row_ptr[j][i]] : 0xFF; |
110 |
- } |
111 |
- |
112 |
-- if (HPDF_Stream_Write (image->stream, row_ptr[j], info_ptr->width) != HPDF_OK) { |
113 |
-+ if (HPDF_Stream_Write (image->stream, row_ptr[j], width) != HPDF_OK) { |
114 |
- ret = HPDF_FILE_IO_ERROR; |
115 |
- goto Error; |
116 |
- } |
117 |
- } |
118 |
- |
119 |
- Error: |
120 |
-- for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) { |
121 |
-+ for (i = 0; i < (HPDF_UINT)height; i++) { |
122 |
- HPDF_FreeMem (image->mmgr, row_ptr[i]); |
123 |
- } |
124 |
- |
125 |
-@@ -238,6 +242,8 @@ ReadTransparentPngData (HPDF_Dict image, |
126 |
- HPDF_UINT i, j; |
127 |
- png_bytep *row_ptr, row; |
128 |
- png_byte color_type; |
129 |
-+ png_uint_32 height = png_get_image_height(png_ptr, info_ptr); |
130 |
-+ png_uint_32 width = png_get_image_width(png_ptr, info_ptr); |
131 |
- |
132 |
- color_type = png_get_color_type(png_ptr, info_ptr); |
133 |
- |
134 |
-@@ -245,16 +251,16 @@ ReadTransparentPngData (HPDF_Dict image, |
135 |
- return HPDF_INVALID_PNG_IMAGE; |
136 |
- } |
137 |
- |
138 |
-- row_ptr = HPDF_GetMem (image->mmgr, info_ptr->height * sizeof(png_bytep)); |
139 |
-+ row_ptr = HPDF_GetMem (image->mmgr, height * sizeof(png_bytep)); |
140 |
- if (!row_ptr) { |
141 |
- return HPDF_FAILD_TO_ALLOC_MEM; |
142 |
- } else { |
143 |
- png_uint_32 len = png_get_rowbytes(png_ptr, info_ptr); |
144 |
- |
145 |
-- for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) { |
146 |
-+ for (i = 0; i < (HPDF_UINT)height; i++) { |
147 |
- row_ptr[i] = HPDF_GetMem(image->mmgr, len); |
148 |
- if (!row_ptr[i]) { |
149 |
-- for (; i >= 0; i--) { |
150 |
-+ for (; i > 0; i--) { |
151 |
- HPDF_FreeMem (image->mmgr, row_ptr[i]); |
152 |
- } |
153 |
- HPDF_FreeMem (image->mmgr, row_ptr); |
154 |
-@@ -271,12 +277,12 @@ ReadTransparentPngData (HPDF_Dict image, |
155 |
- |
156 |
- switch (color_type) { |
157 |
- case PNG_COLOR_TYPE_RGB_ALPHA: |
158 |
-- row_len = 3 * info_ptr->width * sizeof(png_byte); |
159 |
-- for (j = 0; j < info_ptr->height; j++) { |
160 |
-- for (i = 0; i < info_ptr->width; i++) { |
161 |
-+ row_len = 3 * width * sizeof(png_byte); |
162 |
-+ for (j = 0; j < height; j++) { |
163 |
-+ for (i = 0; i < width; i++) { |
164 |
- row = row_ptr[j]; |
165 |
- memmove(row + (3 * i), row + (4*i), 3); |
166 |
-- smask_data[info_ptr->width * j + i] = row[4 * i + 3]; |
167 |
-+ smask_data[width * j + i] = row[4 * i + 3]; |
168 |
- } |
169 |
- |
170 |
- if (HPDF_Stream_Write (image->stream, row, row_len) != HPDF_OK) { |
171 |
-@@ -286,12 +292,12 @@ ReadTransparentPngData (HPDF_Dict image, |
172 |
- } |
173 |
- break; |
174 |
- case PNG_COLOR_TYPE_GRAY_ALPHA: |
175 |
-- row_len = info_ptr->width * sizeof(png_byte); |
176 |
-- for (j = 0; j < info_ptr->height; j++) { |
177 |
-- for (i = 0; i < info_ptr->width; i++) { |
178 |
-+ row_len = width * sizeof(png_byte); |
179 |
-+ for (j = 0; j < height; j++) { |
180 |
-+ for (i = 0; i < width; i++) { |
181 |
- row = row_ptr[j]; |
182 |
- row[i] = row[2 * i]; |
183 |
-- smask_data[info_ptr->width * j + i] = row[2 * i + 1]; |
184 |
-+ smask_data[width * j + i] = row[2 * i + 1]; |
185 |
- } |
186 |
- |
187 |
- if (HPDF_Stream_Write (image->stream, row, row_len) != HPDF_OK) { |
188 |
-@@ -306,7 +312,7 @@ ReadTransparentPngData (HPDF_Dict image, |
189 |
- } |
190 |
- |
191 |
- Error: |
192 |
-- for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) { |
193 |
-+ for (i = 0; i < (HPDF_UINT)height; i++) { |
194 |
- HPDF_FreeMem (image->mmgr, row_ptr[i]); |
195 |
- } |
196 |
- |
197 |
-@@ -415,7 +421,8 @@ LoadPngData (HPDF_Dict image, |
198 |
- |
199 |
- { |
200 |
- HPDF_STATUS ret = HPDF_OK; |
201 |
-- |
202 |
-+ png_uint_32 width, height; |
203 |
-+ int bit_depth, color_type; |
204 |
- png_structp png_ptr = NULL; |
205 |
- png_infop info_ptr = NULL; |
206 |
- |
207 |
-@@ -447,8 +454,10 @@ LoadPngData (HPDF_Dict image, |
208 |
- goto Exit; |
209 |
- } |
210 |
- |
211 |
-+ png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, NULL, NULL, NULL); |
212 |
-+ |
213 |
- /* 16bit images are not supported. */ |
214 |
-- if (info_ptr->bit_depth == 16) { |
215 |
-+ if (bit_depth == 16) { |
216 |
- png_set_strip_16(png_ptr); |
217 |
- } |
218 |
- |
219 |
-@@ -458,7 +467,7 @@ LoadPngData (HPDF_Dict image, |
220 |
- } |
221 |
- |
222 |
- /* check palette-based images for transparent areas and load them immediately if found */ |
223 |
-- if (xref && PNG_COLOR_TYPE_PALETTE & info_ptr->color_type) { |
224 |
-+ if (xref && PNG_COLOR_TYPE_PALETTE & color_type) { |
225 |
- png_bytep trans; |
226 |
- int num_trans; |
227 |
- HPDF_Dict smask; |
228 |
-@@ -478,10 +487,10 @@ LoadPngData (HPDF_Dict image, |
229 |
- smask->header.obj_class |= HPDF_OSUBCLASS_XOBJECT; |
230 |
- ret = HPDF_Dict_AddName (smask, "Type", "XObject"); |
231 |
- ret += HPDF_Dict_AddName (smask, "Subtype", "Image"); |
232 |
-- ret += HPDF_Dict_AddNumber (smask, "Width", (HPDF_UINT)info_ptr->width); |
233 |
-- ret += HPDF_Dict_AddNumber (smask, "Height", (HPDF_UINT)info_ptr->height); |
234 |
-+ ret += HPDF_Dict_AddNumber (smask, "Width", (HPDF_UINT)width); |
235 |
-+ ret += HPDF_Dict_AddNumber (smask, "Height", (HPDF_UINT)height); |
236 |
- ret += HPDF_Dict_AddName (smask, "ColorSpace", "DeviceGray"); |
237 |
-- ret += HPDF_Dict_AddNumber (smask, "BitsPerComponent", (HPDF_UINT)info_ptr->bit_depth); |
238 |
-+ ret += HPDF_Dict_AddNumber (smask, "BitsPerComponent", (HPDF_UINT)bit_depth); |
239 |
- |
240 |
- if (ret != HPDF_OK) { |
241 |
- HPDF_Dict_Free(smask); |
242 |
-@@ -489,7 +498,7 @@ LoadPngData (HPDF_Dict image, |
243 |
- goto Exit; |
244 |
- } |
245 |
- |
246 |
-- smask_data = HPDF_GetMem(image->mmgr, info_ptr->width * info_ptr->height); |
247 |
-+ smask_data = HPDF_GetMem(image->mmgr, width * height); |
248 |
- if (!smask_data) { |
249 |
- HPDF_Dict_Free(smask); |
250 |
- ret = HPDF_FAILD_TO_ALLOC_MEM; |
251 |
-@@ -503,7 +512,7 @@ LoadPngData (HPDF_Dict image, |
252 |
- goto Exit; |
253 |
- } |
254 |
- |
255 |
-- if (HPDF_Stream_Write(smask->stream, smask_data, info_ptr->width * info_ptr->height) != HPDF_OK) { |
256 |
-+ if (HPDF_Stream_Write(smask->stream, smask_data, width * height) != HPDF_OK) { |
257 |
- HPDF_FreeMem(image->mmgr, smask_data); |
258 |
- HPDF_Dict_Free(smask); |
259 |
- ret = HPDF_FILE_IO_ERROR; |
260 |
-@@ -513,9 +522,9 @@ LoadPngData (HPDF_Dict image, |
261 |
- |
262 |
- |
263 |
- ret += CreatePallet(image, png_ptr, info_ptr); |
264 |
-- ret += HPDF_Dict_AddNumber (image, "Width", (HPDF_UINT)info_ptr->width); |
265 |
-- ret += HPDF_Dict_AddNumber (image, "Height", (HPDF_UINT)info_ptr->height); |
266 |
-- ret += HPDF_Dict_AddNumber (image, "BitsPerComponent", (HPDF_UINT)info_ptr->bit_depth); |
267 |
-+ ret += HPDF_Dict_AddNumber (image, "Width", (HPDF_UINT)width); |
268 |
-+ ret += HPDF_Dict_AddNumber (image, "Height", (HPDF_UINT)height); |
269 |
-+ ret += HPDF_Dict_AddNumber (image, "BitsPerComponent", (HPDF_UINT)bit_depth); |
270 |
- ret += HPDF_Dict_Add (image, "SMask", smask); |
271 |
- |
272 |
- png_destroy_read_struct(&png_ptr, &info_ptr, NULL); |
273 |
-@@ -526,7 +535,7 @@ no_transparent_color_in_palette: |
274 |
- |
275 |
- /* read images with alpha channel right away |
276 |
- we have to do this because image transparent mask must be added to the Xref */ |
277 |
-- if (xref && PNG_COLOR_MASK_ALPHA & info_ptr->color_type) { |
278 |
-+ if (xref && PNG_COLOR_MASK_ALPHA & color_type) { |
279 |
- HPDF_Dict smask; |
280 |
- png_bytep smask_data; |
281 |
- |
282 |
-@@ -539,10 +548,10 @@ no_transparent_color_in_palette: |
283 |
- smask->header.obj_class |= HPDF_OSUBCLASS_XOBJECT; |
284 |
- ret = HPDF_Dict_AddName (smask, "Type", "XObject"); |
285 |
- ret += HPDF_Dict_AddName (smask, "Subtype", "Image"); |
286 |
-- ret += HPDF_Dict_AddNumber (smask, "Width", (HPDF_UINT)info_ptr->width); |
287 |
-- ret += HPDF_Dict_AddNumber (smask, "Height", (HPDF_UINT)info_ptr->height); |
288 |
-+ ret += HPDF_Dict_AddNumber (smask, "Width", (HPDF_UINT)width); |
289 |
-+ ret += HPDF_Dict_AddNumber (smask, "Height", (HPDF_UINT)height); |
290 |
- ret += HPDF_Dict_AddName (smask, "ColorSpace", "DeviceGray"); |
291 |
-- ret += HPDF_Dict_AddNumber (smask, "BitsPerComponent", (HPDF_UINT)info_ptr->bit_depth); |
292 |
-+ ret += HPDF_Dict_AddNumber (smask, "BitsPerComponent", (HPDF_UINT)bit_depth); |
293 |
- |
294 |
- if (ret != HPDF_OK) { |
295 |
- HPDF_Dict_Free(smask); |
296 |
-@@ -550,7 +559,7 @@ no_transparent_color_in_palette: |
297 |
- goto Exit; |
298 |
- } |
299 |
- |
300 |
-- smask_data = HPDF_GetMem(image->mmgr, info_ptr->width * info_ptr->height); |
301 |
-+ smask_data = HPDF_GetMem(image->mmgr, width * height); |
302 |
- if (!smask_data) { |
303 |
- HPDF_Dict_Free(smask); |
304 |
- ret = HPDF_FAILD_TO_ALLOC_MEM; |
305 |
-@@ -564,7 +573,7 @@ no_transparent_color_in_palette: |
306 |
- goto Exit; |
307 |
- } |
308 |
- |
309 |
-- if (HPDF_Stream_Write(smask->stream, smask_data, info_ptr->width * info_ptr->height) != HPDF_OK) { |
310 |
-+ if (HPDF_Stream_Write(smask->stream, smask_data, width * height) != HPDF_OK) { |
311 |
- HPDF_FreeMem(image->mmgr, smask_data); |
312 |
- HPDF_Dict_Free(smask); |
313 |
- ret = HPDF_FILE_IO_ERROR; |
314 |
-@@ -572,14 +581,14 @@ no_transparent_color_in_palette: |
315 |
- } |
316 |
- HPDF_FreeMem(image->mmgr, smask_data); |
317 |
- |
318 |
-- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { |
319 |
-+ if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { |
320 |
- ret += HPDF_Dict_AddName (image, "ColorSpace", "DeviceGray"); |
321 |
- } else { |
322 |
- ret += HPDF_Dict_AddName (image, "ColorSpace", "DeviceRGB"); |
323 |
- } |
324 |
-- ret += HPDF_Dict_AddNumber (image, "Width", (HPDF_UINT)info_ptr->width); |
325 |
-- ret += HPDF_Dict_AddNumber (image, "Height", (HPDF_UINT)info_ptr->height); |
326 |
-- ret += HPDF_Dict_AddNumber (image, "BitsPerComponent", (HPDF_UINT)info_ptr->bit_depth); |
327 |
-+ ret += HPDF_Dict_AddNumber (image, "Width", (HPDF_UINT)width); |
328 |
-+ ret += HPDF_Dict_AddNumber (image, "Height", (HPDF_UINT)height); |
329 |
-+ ret += HPDF_Dict_AddNumber (image, "BitsPerComponent", (HPDF_UINT)bit_depth); |
330 |
- ret += HPDF_Dict_Add (image, "SMask", smask); |
331 |
- |
332 |
- png_destroy_read_struct(&png_ptr, &info_ptr, NULL); |
333 |
-@@ -589,9 +598,9 @@ no_transparent_color_in_palette: |
334 |
- /* if the image has color palette, copy the pallet of the image to |
335 |
- * create color map. |
336 |
- */ |
337 |
-- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) |
338 |
-+ if (color_type == PNG_COLOR_TYPE_PALETTE) |
339 |
- ret = CreatePallet(image, png_ptr, info_ptr); |
340 |
-- else if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY) |
341 |
-+ else if (color_type == PNG_COLOR_TYPE_GRAY) |
342 |
- ret = HPDF_Dict_AddName (image, "ColorSpace", "DeviceGray"); |
343 |
- else |
344 |
- ret = HPDF_Dict_AddName (image, "ColorSpace", "DeviceRGB"); |
345 |
-@@ -617,16 +626,16 @@ no_transparent_color_in_palette: |
346 |
- } |
347 |
- |
348 |
- /* setting the info of the image. */ |
349 |
-- if (HPDF_Dict_AddNumber (image, "Width", (HPDF_UINT)info_ptr->width) |
350 |
-+ if (HPDF_Dict_AddNumber (image, "Width", (HPDF_UINT)width) |
351 |
- != HPDF_OK) |
352 |
- goto Exit; |
353 |
- |
354 |
-- if (HPDF_Dict_AddNumber (image, "Height", (HPDF_UINT)info_ptr->height) |
355 |
-+ if (HPDF_Dict_AddNumber (image, "Height", (HPDF_UINT)height) |
356 |
- != HPDF_OK) |
357 |
- goto Exit; |
358 |
- |
359 |
- if (HPDF_Dict_AddNumber (image, "BitsPerComponent", |
360 |
-- (HPDF_UINT)info_ptr->bit_depth) != HPDF_OK) |
361 |
-+ (HPDF_UINT)bit_depth) != HPDF_OK) |
362 |
- goto Exit; |
363 |
- |
364 |
- /* clean up */ |