Gentoo Archives: gentoo-commits

From: "Andreas HAttel (dilfridge)" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-misc/gcam/files: gcam-2010.07.27-libpng15.patch
Date: Sun, 08 Jan 2012 19:17:42
Message-Id: 20120108191732.2EF7A2004C@flycatcher.gentoo.org
1 dilfridge 12/01/08 19:17:32
2
3 Added: gcam-2010.07.27-libpng15.patch
4 Log:
5 Fix build with libpng-1.5; thanks a lot to Samuli
6
7 (Portage version: 2.1.10.44/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 sci-misc/gcam/files/gcam-2010.07.27-libpng15.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-misc/gcam/files/gcam-2010.07.27-libpng15.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-misc/gcam/files/gcam-2010.07.27-libpng15.patch?rev=1.1&content-type=text/plain
14
15 Index: gcam-2010.07.27-libpng15.patch
16 ===================================================================
17 diff -ruN gcam-2010.07.27.orig/libgcode/gcode_image.c gcam-2010.07.27/libgcode/gcode_image.c
18 --- gcam-2010.07.27.orig/libgcode/gcode_image.c 2010-07-23 17:15:13.000000000 +0200
19 +++ gcam-2010.07.27/libgcode/gcode_image.c 2012-01-08 20:07:35.000000000 +0100
20 @@ -260,8 +260,8 @@
21
22 png_read_info (png_ptr, info_ptr);
23
24 - image->res[0] = info_ptr->width;
25 - image->res[1] = info_ptr->height;
26 + image->res[0] = png_get_image_width(png_ptr, info_ptr);
27 + image->res[1] = png_get_image_height(png_ptr, info_ptr);
28
29 /* printf ("image size: %dx%d\n", image->res[0], image->res[1]); */
30
31 @@ -274,16 +274,16 @@
32
33 row_pointers = (png_bytep *) malloc (sizeof (png_bytep) * image->res[1]);
34 for (y = 0; y < image->res[1]; y++)
35 - row_pointers[y] = (png_byte*) malloc (info_ptr->rowbytes);
36 + row_pointers[y] = (png_byte*) malloc (png_get_rowbytes(png_ptr, info_ptr));
37
38 png_read_image (png_ptr, row_pointers);
39
40 image->dmap = (gfloat_t *) malloc (sizeof (gfloat_t) * image->res[0] * image->res[1]);
41
42 incr = 1;
43 - if (info_ptr->color_type & PNG_COLOR_MASK_COLOR)
44 + if (png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_COLOR)
45 incr = 3;
46 - if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
47 + if (png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA)
48 incr = 4;
49
50 for (y = 0; y < image->res[1]; y++)