Gentoo Archives: gentoo-commits

From: "Hans de Graaff (graaff)" <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-editors/xemacs/files: xemacs-21.4.22-libpng15.patch
Date: Mon, 26 Sep 2011 18:28:12
Message-Id: 20110926182802.75B812004C@flycatcher.gentoo.org
1 graaff 11/09/26 18:28:02
2
3 Added: xemacs-21.4.22-libpng15.patch
4 Log:
5 Fix compilation with libpng 1.5, thanks to Samuli Suominen in bug 384461.
6
7 (Portage version: 2.1.10.11/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 app-editors/xemacs/files/xemacs-21.4.22-libpng15.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/xemacs/files/xemacs-21.4.22-libpng15.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/xemacs/files/xemacs-21.4.22-libpng15.patch?rev=1.1&content-type=text/plain
14
15 Index: xemacs-21.4.22-libpng15.patch
16 ===================================================================
17 diff -ur xemacs-21.4.22.orig/src/glyphs-eimage.c xemacs-21.4.22/src/glyphs-eimage.c
18 --- xemacs-21.4.22.orig/src/glyphs-eimage.c 2011-09-26 19:44:57.889720996 +0300
19 +++ xemacs-21.4.22/src/glyphs-eimage.c 2011-09-26 19:48:07.026226254 +0300
20 @@ -946,8 +946,8 @@
21 int y;
22 unsigned char **row_pointers;
23 UINT_64_BIT pixels_sq;
24 - height = info_ptr->height;
25 - width = info_ptr->width;
26 + height = png_get_image_height(png_ptr, info_ptr);
27 + width = png_get_image_width(png_ptr, info_ptr);
28 pixels_sq = (UINT_64_BIT) width * (UINT_64_BIT) height;
29 if (pixels_sq > ((size_t) -1) / 3)
30 signal_image_error ("PNG image too large to instantiate", instantiator);
31 @@ -1002,22 +1002,22 @@
32 /* Now that we're using EImage, ask for 8bit RGB triples for any type
33 of image*/
34 /* convert palette images to full RGB */
35 - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
36 + if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE)
37 png_set_expand (png_ptr);
38 /* send grayscale images to RGB too */
39 - if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
40 - info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
41 + if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY ||
42 + png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA)
43 png_set_gray_to_rgb (png_ptr);
44 /* we can't handle alpha values */
45 - if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
46 + if (png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA)
47 png_set_strip_alpha (png_ptr);
48 /* tell libpng to strip 16 bit depth files down to 8 bits */
49 - if (info_ptr->bit_depth == 16)
50 + if (png_get_bit_depth(png_ptr, info_ptr) == 16)
51 png_set_strip_16 (png_ptr);
52 /* if the image is < 8 bits, pad it out */
53 - if (info_ptr->bit_depth < 8)
54 + if (png_get_bit_depth(png_ptr, info_ptr) < 8)
55 {
56 - if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY)
57 + if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY)
58 png_set_expand (png_ptr);
59 else
60 png_set_packing (png_ptr);
61 @@ -1036,16 +1036,18 @@
62 */
63 {
64 int i;
65 + png_textp text;
66 + int num_text;
67
68 - for (i = 0 ; i < info_ptr->num_text ; i++)
69 + for (i = 0 ; i < num_text ; i++)
70 {
71 /* How paranoid do I have to be about no trailing NULLs, and
72 using (int)info_ptr->text[i].text_length, and strncpy and a temp
73 string somewhere? */
74
75 warn_when_safe (Qpng, Qinfo, "%s - %s",
76 - info_ptr->text[i].key,
77 - info_ptr->text[i].text);
78 + text[i].key,
79 + text[i].text);
80 }
81 }
82 #endif