]>
Commit | Line | Data |
---|---|---|
1c82da14 JB |
1 | --- autotrace-0.31.1/input-png.c.orig 2002-10-10 22:44:14.000000000 +0200 |
2 | +++ autotrace-0.31.1/input-png.c 2013-03-22 20:20:49.835238916 +0100 | |
3 | @@ -42,17 +42,17 @@ | |
4 | ||
5 | static void handle_warning(png_structp png, const at_string message) { | |
6 | LOG1("PNG warning: %s", message); | |
7 | - at_exception_warning((at_exception_type *)png->error_ptr, | |
8 | + at_exception_warning((at_exception_type *)png_get_error_ptr(png), | |
9 | message); | |
10 | - /* at_exception_fatal((at_exception_type *)at_png->error_ptr, | |
11 | + /* at_exception_fatal((at_exception_type *)png_get_error_ptr(at_png), | |
12 | "PNG warning"); */ | |
13 | } | |
14 | ||
15 | static void handle_error(png_structp png, const at_string message) { | |
16 | LOG1("PNG error: %s", message); | |
17 | - at_exception_fatal((at_exception_type *)png->error_ptr, | |
18 | + at_exception_fatal((at_exception_type *)png_get_error_ptr(png), | |
19 | message); | |
20 | - /* at_exception_fatal((at_exception_type *)at_png->error_ptr, | |
21 | + /* at_exception_fatal((at_exception_type *)png_get_error_ptr(at_png), | |
22 | "PNG error"); */ | |
23 | ||
24 | } | |
25 | @@ -157,8 +157,8 @@ | |
26 | ||
27 | png_set_strip_16(png_ptr); | |
28 | png_set_packing(png_ptr); | |
29 | - if ((png_ptr->bit_depth < 8) || | |
30 | - (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) || | |
31 | + if ((png_get_bit_depth(png_ptr, info_ptr) < 8) || | |
32 | + (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) || | |
33 | (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) | |
34 | png_set_expand(png_ptr); | |
35 | ||
36 | @@ -184,17 +184,16 @@ | |
37 | png_read_update_info(png_ptr, info_ptr); | |
38 | ||
39 | ||
40 | - info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr, | |
41 | - info_ptr->height * sizeof(png_bytep)); | |
42 | + png_set_rows(png_ptr, info_ptr, (png_bytepp)png_malloc(png_ptr, | |
43 | + png_get_image_height(png_ptr, info_ptr) * sizeof(png_bytep))); | |
44 | #ifdef PNG_FREE_ME_SUPPORTED | |
45 | info_ptr->free_me |= PNG_FREE_ROWS; | |
46 | #endif | |
47 | - for (row = 0; row < (int)info_ptr->height; row++) | |
48 | - info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr, | |
49 | + for (row = 0; row < (int)png_get_image_height(png_ptr, info_ptr); row++) | |
50 | + png_get_rows(png_ptr, info_ptr)[row] = (png_bytep)png_malloc(png_ptr, | |
51 | png_get_rowbytes(png_ptr, info_ptr)); | |
52 | ||
53 | - png_read_image(png_ptr, info_ptr->row_pointers); | |
54 | - info_ptr->valid |= PNG_INFO_IDAT; | |
55 | + png_read_image(png_ptr, png_get_rows(png_ptr, info_ptr)); | |
56 | png_read_end(png_ptr, info_ptr); | |
57 | return png_get_rows(png_ptr, info_ptr); | |
58 | } |