1 |
vapier 11/02/22 21:33:53 |
2 |
|
3 |
Added: autotrace-0.31.1-libpng-1.5.patch |
4 |
Log: |
5 |
Fix building with libpng-1.5. |
6 |
|
7 |
(Portage version: 2.2.0_alpha24/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 media-gfx/autotrace/files/autotrace-0.31.1-libpng-1.5.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/autotrace/files/autotrace-0.31.1-libpng-1.5.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/autotrace/files/autotrace-0.31.1-libpng-1.5.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: autotrace-0.31.1-libpng-1.5.patch |
16 |
=================================================================== |
17 |
http://sourceforge.net/mailarchive/forum.php?thread_name=01e601cbc22e%24f45d7200%24dd185600%24%40acm.org&forum_name=png-mng-implement |
18 |
|
19 |
$NetBSD$ |
20 |
|
21 |
Fix build with png-1.5. |
22 |
|
23 |
--- input-png.c.orig 2002-10-10 20:44:14.000000000 +0000 |
24 |
+++ input-png.c |
25 |
@@ -42,17 +42,17 @@ static png_bytep * read_png(png_structp |
26 |
|
27 |
static void handle_warning(png_structp png, const at_string message) { |
28 |
LOG1("PNG warning: %s", message); |
29 |
- at_exception_warning((at_exception_type *)png->error_ptr, |
30 |
+ at_exception_warning((at_exception_type *)png_get_error_ptr(png), |
31 |
message); |
32 |
- /* at_exception_fatal((at_exception_type *)at_png->error_ptr, |
33 |
+ /* at_exception_fatal((at_exception_type *)png_get_error_ptr(at_png), |
34 |
"PNG warning"); */ |
35 |
} |
36 |
|
37 |
static void handle_error(png_structp png, const at_string message) { |
38 |
LOG1("PNG error: %s", message); |
39 |
- at_exception_fatal((at_exception_type *)png->error_ptr, |
40 |
+ at_exception_fatal((at_exception_type *)png_get_error_ptr(png), |
41 |
message); |
42 |
- /* at_exception_fatal((at_exception_type *)at_png->error_ptr, |
43 |
+ /* at_exception_fatal((at_exception_type *)png_get_error_ptr(at_png), |
44 |
"PNG error"); */ |
45 |
|
46 |
} |
47 |
@@ -157,8 +157,8 @@ read_png(png_structp png_ptr, png_infop |
48 |
|
49 |
png_set_strip_16(png_ptr); |
50 |
png_set_packing(png_ptr); |
51 |
- if ((png_ptr->bit_depth < 8) || |
52 |
- (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) || |
53 |
+ if ((png_get_bit_depth(png_ptr, info_ptr) < 8) || |
54 |
+ (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) || |
55 |
(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) |
56 |
png_set_expand(png_ptr); |
57 |
|
58 |
@@ -181,20 +181,10 @@ read_png(png_structp png_ptr, png_infop |
59 |
PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); |
60 |
} else |
61 |
png_set_strip_alpha(png_ptr); |
62 |
+ png_set_interlace_handling(png_ptr); |
63 |
png_read_update_info(png_ptr, info_ptr); |
64 |
|
65 |
- |
66 |
- info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr, |
67 |
- info_ptr->height * sizeof(png_bytep)); |
68 |
-#ifdef PNG_FREE_ME_SUPPORTED |
69 |
- info_ptr->free_me |= PNG_FREE_ROWS; |
70 |
-#endif |
71 |
- for (row = 0; row < (int)info_ptr->height; row++) |
72 |
- info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr, |
73 |
- png_get_rowbytes(png_ptr, info_ptr)); |
74 |
- |
75 |
- png_read_image(png_ptr, info_ptr->row_pointers); |
76 |
- info_ptr->valid |= PNG_INFO_IDAT; |
77 |
+ png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL); |
78 |
png_read_end(png_ptr, info_ptr); |
79 |
return png_get_rows(png_ptr, info_ptr); |
80 |
} |