Gentoo Archives: gentoo-commits

From: "Michael Januszewski (spock)" <spock@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-gfx/splashutils/files: splashutils-1.5.4.3-libpng15_compat.patch
Date: Sun, 08 May 2011 15:30:24
Message-Id: 20110508153015.3E90120057@flycatcher.gentoo.org
1 spock 11/05/08 15:30:15
2
3 Added: splashutils-1.5.4.3-libpng15_compat.patch
4 Log:
5 Add a patch for libpng-1.5 compatiblity (bug #361333).
6
7 (Portage version: 2.1.9.47/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 media-gfx/splashutils/files/splashutils-1.5.4.3-libpng15_compat.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/splashutils/files/splashutils-1.5.4.3-libpng15_compat.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/splashutils/files/splashutils-1.5.4.3-libpng15_compat.patch?rev=1.1&content-type=text/plain
14
15 Index: splashutils-1.5.4.3-libpng15_compat.patch
16 ===================================================================
17 commit 1b760b583f1faa0d3114440a6746cbefa36dd797
18 Author: AlphatPC <AlphatPC@×××××.com>
19 Date: Sun May 8 17:18:03 2011 +0200
20
21 Use libpng accessor functions (for libpng-1.5 compat).
22
23 diff --git a/core/src/image.c b/core/src/image.c
24 index 6973575..4fb21a9 100644
25 --- a/core/src/image.c
26 +++ b/core/src/image.c
27 @@ -61,27 +61,27 @@ static int load_png(stheme_t *theme, char *filename, u8 **data, struct fb_cmap *
28 png_init_io(png_ptr, fp);
29 png_read_info(png_ptr, info_ptr);
30
31 - if (cmap && info_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
32 + if (cmap && png_get_color_type(png_ptr, info_ptr) != PNG_COLOR_TYPE_PALETTE)
33 return -2;
34
35 - if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
36 - info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
37 + if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY ||
38 + png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA)
39 png_set_gray_to_rgb(png_ptr);
40
41 - if (info_ptr->bit_depth == 16)
42 + if (png_get_bit_depth(png_ptr, info_ptr) == 16)
43 png_set_strip_16(png_ptr);
44
45 - if (!want_alpha && info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
46 + if (!want_alpha && png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA)
47 png_set_strip_alpha(png_ptr);
48
49 #ifndef TARGET_KERNEL
50 - if (!(info_ptr->color_type & PNG_COLOR_MASK_ALPHA) & want_alpha) {
51 + if (!(png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA) & want_alpha) {
52 png_set_add_alpha(png_ptr, 0xff, PNG_FILLER_AFTER);
53 }
54 #endif
55 png_read_update_info(png_ptr, info_ptr);
56
57 - if (!cmap && info_ptr->color_type != PNG_COLOR_TYPE_RGB && info_ptr->color_type != PNG_COLOR_TYPE_RGBA)
58 + 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)
59 return -3;
60
61 if (cmap) {
62 @@ -93,12 +93,12 @@ static int load_png(stheme_t *theme, char *filename, u8 **data, struct fb_cmap *
63
64 rowbytes = png_get_rowbytes(png_ptr, info_ptr);
65
66 - if ((width && *width && info_ptr->width != *width) || (height && *height && info_ptr->height != *height)) {
67 + if ((width && *width && png_get_image_width(png_ptr, info_ptr) != *width) || (height && *height && png_get_image_height(png_ptr, info_ptr) != *height)) {
68 iprint(MSG_ERROR, "Image size mismatch: %s.\n", filename);
69 return -2;
70 } else {
71 - *width = info_ptr->width;
72 - *height = info_ptr->height;
73 + *width = png_get_image_width(png_ptr, info_ptr);
74 + *height = png_get_image_height(png_ptr, info_ptr);
75 }
76
77 *data = malloc(theme->xres * theme->yres * fbd.bytespp);
78 @@ -114,11 +114,11 @@ static int load_png(stheme_t *theme, char *filename, u8 **data, struct fb_cmap *
79 return -4;
80 }
81
82 - for (i = 0; i < info_ptr->height; i++) {
83 + for (i = 0; i < png_get_image_height(png_ptr, info_ptr); i++) {
84 if (cmap) {
85 - row_pointer = *data + info_ptr->width * i;
86 + row_pointer = *data + png_get_image_width(png_ptr, info_ptr) * i;
87 } else if (want_alpha) {
88 - row_pointer = *data + info_ptr->width * i * 4;
89 + row_pointer = *data + png_get_image_width(png_ptr, info_ptr) * i * 4;
90 } else {
91 row_pointer = buf;
92 }
93 @@ -127,7 +127,7 @@ static int load_png(stheme_t *theme, char *filename, u8 **data, struct fb_cmap *
94
95 if (cmap) {
96 int h = 256 - cmap->len;
97 - t = *data + info_ptr->width * i;
98 + t = *data + png_get_image_width(png_ptr, info_ptr) * i;
99
100 if (h) {
101 /* Move the colors up by 'h' offset. This is used because fbcon
102 @@ -139,8 +139,8 @@ static int load_png(stheme_t *theme, char *filename, u8 **data, struct fb_cmap *
103
104 /* We only need to convert the image if the alpha channel is not required */
105 } else if (!want_alpha) {
106 - u8 *tmp = *data + info_ptr->width * bytespp * i;
107 - rgba2fb((rgbacolor*)buf, tmp, tmp, info_ptr->width, i, 0, 0xff);
108 + u8 *tmp = *data + png_get_image_width(png_ptr, info_ptr) * bytespp * i;
109 + rgba2fb((rgbacolor*)buf, tmp, tmp, png_get_image_width(png_ptr, info_ptr), i, 0, 0xff);
110 }
111 }