1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
$NetBSD: patch-af,v 1.4 2014/05/23 22:29:33 dholland Exp $
* Build fix for newer versions of "libpng".
* Build fix for 5.0 version of giflib.
* Further build fixes for giflib 5.1.
--- src/image.c.orig 2008-08-25 22:18:33.000000000 +0000
+++ src/image.c
@@ -6328,11 +6328,7 @@ png_image_p (object)
#ifdef HAVE_PNG
-#if defined HAVE_LIBPNG_PNG_H
-# include <libpng/png.h>
-#else
# include <png.h>
-#endif
#ifdef HAVE_NTGUI
/* PNG library details. */
@@ -6427,7 +6423,11 @@ my_png_error (png_ptr, msg)
{
xassert (png_ptr != NULL);
image_error ("PNG error: %s", build_string (msg), Qnil);
+#if (PNG_LIBPNG_VER < 10500)
longjmp (png_ptr->jmpbuf, 1);
+#else
+ png_longjmp (png_ptr, 1);
+#endif
}
@@ -6603,7 +6603,7 @@ png_load (f, img)
/* Set error jump-back. We come back here when the PNG library
detects an error. */
- if (setjmp (png_ptr->jmpbuf))
+ if (setjmp (png_jmpbuf(png_ptr)))
{
error:
if (png_ptr)
@@ -8108,7 +8108,7 @@ gif_load (f, img)
/* Open the GIF file. Casting return value avoids a GCC warning
on W32. */
- gif = (GifFileType *)fn_DGifOpenFileName (SDATA (file));
+ gif = (GifFileType *)fn_DGifOpenFileName (SDATA (file), NULL);
if (gif == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
@@ -8125,7 +8125,7 @@ gif_load (f, img)
memsrc.index = 0;
/* Casting return value avoids a GCC warning on W32. */
- gif = (GifFileType *)fn_DGifOpen(&memsrc, gif_read_from_memory);
+ gif = (GifFileType *)fn_DGifOpen(&memsrc, gif_read_from_memory, NULL);
if (!gif)
{
image_error ("Cannot open memory source `%s'", img->spec, Qnil);
@@ -8138,7 +8138,7 @@ gif_load (f, img)
if (!check_image_size (f, gif->SWidth, gif->SHeight))
{
image_error ("Invalid image size", Qnil, Qnil);
- fn_DGifCloseFile (gif);
+ fn_DGifCloseFile (gif, NULL);
UNGCPRO;
return 0;
}
@@ -8148,7 +8148,7 @@ gif_load (f, img)
if (rc == GIF_ERROR)
{
image_error ("Error reading `%s'", img->spec, Qnil);
- fn_DGifCloseFile (gif);
+ fn_DGifCloseFile (gif, NULL);
UNGCPRO;
return 0;
}
@@ -8159,7 +8159,7 @@ gif_load (f, img)
{
image_error ("Invalid image number `%s' in image `%s'",
image, img->spec);
- fn_DGifCloseFile (gif);
+ fn_DGifCloseFile (gif, NULL);
UNGCPRO;
return 0;
}
@@ -8181,7 +8181,7 @@ gif_load (f, img)
if (!check_image_size (f, width, height))
{
image_error ("Invalid image size", Qnil, Qnil);
- fn_DGifCloseFile (gif);
+ fn_DGifCloseFile (gif, NULL);
UNGCPRO;
return 0;
}
@@ -8189,7 +8189,7 @@ gif_load (f, img)
/* Create the X image and pixmap. */
if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
{
- fn_DGifCloseFile (gif);
+ fn_DGifCloseFile (gif, NULL);
UNGCPRO;
return 0;
}
@@ -8296,7 +8296,7 @@ gif_load (f, img)
Fcons (make_number (gif->ImageCount),
img->data.lisp_val));
- fn_DGifCloseFile (gif);
+ fn_DGifCloseFile (gif, NULL);
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
|