Magellan Linux

Annotation of /trunk/imlib2/patches/imlib2-1.4.4-libpng-1.5.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1292 - (hide annotations) (download)
Tue Mar 1 19:21:06 2011 UTC (13 years, 3 months ago) by niro
File size: 2540 byte(s)
-added libpng-1.5 patch
1 niro 1292 http://bugs.gentoo.org/354989
2    
3     # http://sourceforge.net/mailarchive/message.php?msg_id=26972342
4    
5     $NetBSD: patch-af,v 1.4 2011/01/14 10:02:54 wiz Exp $
6    
7     Fix build with png-1.5.
8    
9     has also been committed upstream.
10    
11     --- src/modules/loaders/loader_png.c
12     +++ src/modules/loaders/loader_png.c
13     @@ -58,7 +58,7 @@
14     fclose(f);
15     return 0;
16     }
17     - if (setjmp(png_ptr->jmpbuf))
18     + if (setjmp(png_jmpbuf(png_ptr)))
19     {
20     png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
21     fclose(f);
22     @@ -238,7 +238,7 @@
23     png_structp png_ptr;
24     png_infop info_ptr;
25     DATA32 *ptr;
26     - int x, y, j;
27     + int x, y, j, interlace;
28     png_bytep row_ptr, data = NULL;
29     png_color_8 sig_bit;
30     int pl = 0;
31     @@ -265,7 +265,7 @@
32     png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
33     return 0;
34     }
35     - if (setjmp(png_ptr->jmpbuf))
36     + if (setjmp(png_jmpbuf(png_ptr)))
37     {
38     fclose(f);
39     png_destroy_write_struct(&png_ptr, (png_infopp) & info_ptr);
40     @@ -274,11 +274,11 @@
41     }
42    
43     /* check whether we should use interlacing */
44     + interlace = PNG_INTERLACE_NONE;
45     if ((tag = __imlib_GetTag(im, "interlacing")) && tag->val)
46     {
47     #ifdef PNG_WRITE_INTERLACING_SUPPORTED
48     - png_ptr->interlaced = PNG_INTERLACE_ADAM7;
49     - num_passes = png_set_interlace_handling(png_ptr);
50     + interlace = PNG_INTERLACE_ADAM7;
51     #endif
52     }
53    
54     @@ -286,7 +286,7 @@
55     if (im->flags & F_HAS_ALPHA)
56     {
57     png_set_IHDR(png_ptr, info_ptr, im->w, im->h, 8,
58     - PNG_COLOR_TYPE_RGB_ALPHA, png_ptr->interlaced,
59     + PNG_COLOR_TYPE_RGB_ALPHA, interlace,
60     PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
61     #ifdef WORDS_BIGENDIAN
62     png_set_swap_alpha(png_ptr);
63     @@ -297,7 +297,7 @@
64     else
65     {
66     png_set_IHDR(png_ptr, info_ptr, im->w, im->h, 8, PNG_COLOR_TYPE_RGB,
67     - png_ptr->interlaced, PNG_COMPRESSION_TYPE_BASE,
68     + interlace, PNG_COMPRESSION_TYPE_BASE,
69     PNG_FILTER_TYPE_BASE);
70     data = malloc(im->w * 3 * sizeof(char));
71     }
72     @@ -344,6 +344,10 @@
73     png_set_shift(png_ptr, &sig_bit);
74     png_set_packing(png_ptr);
75    
76     +#ifdef PNG_WRITE_INTERLACING_SUPPORTED
77     + num_passes = png_set_interlace_handling(png_ptr);
78     +#endif
79     +
80     for (pass = 0; pass < num_passes; pass++)
81     {
82     ptr = im->data;