1 |
hwoarang 11/09/26 15:34:41 |
2 |
|
3 |
Added: tuxonice-userui-1.0-libpng15.patch |
4 |
Log: |
5 |
Add libpng-1.5 patch. Thanks to Samuli Suominen <ssuominen@g.o>. Bug #384481 |
6 |
|
7 |
(Portage version: 2.2.0_alpha55/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 sys-apps/tuxonice-userui/files/tuxonice-userui-1.0-libpng15.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/tuxonice-userui/files/tuxonice-userui-1.0-libpng15.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/tuxonice-userui/files/tuxonice-userui-1.0-libpng15.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: tuxonice-userui-1.0-libpng15.patch |
16 |
=================================================================== |
17 |
--- fbsplash/image.c |
18 |
+++ fbsplash/image.c |
19 |
@@ -112,29 +112,29 @@ |
20 |
png_init_io(png_ptr, fp); |
21 |
png_read_info(png_ptr, info_ptr); |
22 |
|
23 |
- if (cmap && info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) { |
24 |
+ if (cmap && png_get_color_type(png_ptr, info_ptr) != PNG_COLOR_TYPE_PALETTE) { |
25 |
printerr("Could not read file %s. Not a palette-based image.\n", filename); |
26 |
goto failed; |
27 |
} |
28 |
|
29 |
- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY || |
30 |
- info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) |
31 |
+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY || |
32 |
+ png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA) |
33 |
png_set_gray_to_rgb(png_ptr); |
34 |
|
35 |
- if (info_ptr->bit_depth == 16) |
36 |
+ if (png_get_bit_depth(png_ptr, info_ptr) == 16) |
37 |
png_set_strip_16(png_ptr); |
38 |
|
39 |
- if (!want_alpha && info_ptr->color_type & PNG_COLOR_MASK_ALPHA) |
40 |
+ if (!want_alpha && png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA) |
41 |
png_set_strip_alpha(png_ptr); |
42 |
|
43 |
#ifndef TARGET_KERNEL |
44 |
- if (!(info_ptr->color_type & PNG_COLOR_MASK_ALPHA) & want_alpha) { |
45 |
+ if (!(png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA) & want_alpha) { |
46 |
png_set_add_alpha(png_ptr, 0xff, PNG_FILLER_AFTER); |
47 |
} |
48 |
#endif |
49 |
png_read_update_info(png_ptr, info_ptr); |
50 |
|
51 |
- if (!cmap && info_ptr->color_type != PNG_COLOR_TYPE_RGB && info_ptr->color_type != PNG_COLOR_TYPE_RGBA) { |
52 |
+ if (!cmap && png_get_color_type(png_ptr, info_ptr) != PNG_COLOR_TYPE_RGB && png_get_color_type(png_ptr, info_ptr) != PNG_COLOR_TYPE_RGBA) { |
53 |
printerr("Could not read file %s. Not an RGB image.\n", filename); |
54 |
goto failed; |
55 |
} |
56 |
@@ -150,12 +150,12 @@ |
57 |
|
58 |
rowbytes = png_get_rowbytes(png_ptr, info_ptr); |
59 |
|
60 |
- if ((width && *width && info_ptr->width != *width) || (height && *height && info_ptr->height != *height)) { |
61 |
+ if ((width && *width && png_get_image_width(png_ptr, info_ptr) != *width) || (height && *height && png_get_image_height(png_ptr, info_ptr) != *height)) { |
62 |
printerr("Image size mismatch: %s.\n", filename); |
63 |
goto failed; |
64 |
} else { |
65 |
- *width = info_ptr->width; |
66 |
- *height = info_ptr->height; |
67 |
+ *width = png_get_image_width(png_ptr, info_ptr); |
68 |
+ *height = png_get_image_height(png_ptr, info_ptr); |
69 |
} |
70 |
|
71 |
*data = malloc(fb_var.xres * fb_var.yres * bytespp); |
72 |
@@ -171,11 +171,11 @@ |
73 |
goto failed; |
74 |
} |
75 |
|
76 |
- for (i = 0; i < info_ptr->height; i++) { |
77 |
+ for (i = 0; i < png_get_image_height(png_ptr, info_ptr); i++) { |
78 |
if (cmap) { |
79 |
- row_pointer = *data + info_ptr->width * i; |
80 |
+ row_pointer = *data + png_get_image_width(png_ptr, info_ptr) * i; |
81 |
} else if (want_alpha) { |
82 |
- row_pointer = *data + info_ptr->width * i * 4; |
83 |
+ row_pointer = *data + png_get_image_width(png_ptr, info_ptr) * i * 4; |
84 |
} else { |
85 |
row_pointer = buf; |
86 |
} |
87 |
@@ -184,7 +184,7 @@ |
88 |
|
89 |
if (cmap) { |
90 |
int h = 256 - cmap->len; |
91 |
- t = *data + info_ptr->width * i; |
92 |
+ t = *data + png_get_image_width(png_ptr, info_ptr) * i; |
93 |
|
94 |
if (h) { |
95 |
/* Move the colors up by 'h' offset. This is used because fbcon |
96 |
@@ -196,7 +196,7 @@ |
97 |
|
98 |
/* We only need to convert the image if we the alpha channel is not required */ |
99 |
} else if (!want_alpha) { |
100 |
- truecolor2fb((truecolor*)buf, *data + info_ptr->width * bytespp * i, info_ptr->width, i, 0); |
101 |
+ truecolor2fb((truecolor*)buf, *data + png_get_image_width(png_ptr, info_ptr) * bytespp * i, png_get_image_width(png_ptr, info_ptr), i, 0); |
102 |
} |
103 |
} |