[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with image libraries on Windows (reprise)
From: |
Juanma Barranquero |
Subject: |
Re: Problem with image libraries on Windows (reprise) |
Date: |
Wed, 15 Jun 2005 12:34:50 +0200 |
The PNG patch:
Index: src/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/src/ChangeLog,v
retrieving revision 1.4462
diff -u -2 -r1.4462 ChangeLog
--- src/ChangeLog 15 Jun 2005 02:30:03 -0000 1.4462
+++ src/ChangeLog 15 Jun 2005 09:16:33 -0000
@@ -1,2 +1,9 @@
+2005-06-15 Juanma Barranquero <address@hidden>
+
+ * image.c (fn_png_init_io): Don't define it.
+ (init_png_functions) [HAVE_NTGUI]: Don't initialize fn_png_init_io.
+ (png_read_from_file): New function, based on png_read_from_memory.
+ (png_load): Use it, instead of fn_png_init_io.
+
2005-06-15 YAMAMOTO Mitsuharu <address@hidden>
Index: src/image.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/image.c,v
retrieving revision 1.27
diff -u -2 -r1.27 image.c
--- src/image.c 11 Jun 2005 16:24:36 -0000 1.27
+++ src/image.c 15 Jun 2005 09:16:25 -0000
@@ -5632,5 +5632,4 @@
DEF_IMGLIB_FN (png_destroy_read_struct);
DEF_IMGLIB_FN (png_set_read_fn);
-DEF_IMGLIB_FN (png_init_io);
DEF_IMGLIB_FN (png_set_sig_bytes);
DEF_IMGLIB_FN (png_read_info);
@@ -5664,5 +5663,4 @@
LOAD_IMGLIB_FN (library, png_destroy_read_struct);
LOAD_IMGLIB_FN (library, png_set_read_fn);
- LOAD_IMGLIB_FN (library, png_init_io);
LOAD_IMGLIB_FN (library, png_set_sig_bytes);
LOAD_IMGLIB_FN (library, png_read_info);
@@ -5690,5 +5688,4 @@
#define fn_png_destroy_read_struct png_destroy_read_struct
#define fn_png_set_read_fn png_set_read_fn
-#define fn_png_init_io png_init_io
#define fn_png_set_sig_bytes png_set_sig_bytes
#define fn_png_read_info png_read_info
@@ -5763,4 +5760,21 @@
+/* Function set as reader function when reading PNG image from a file.
+ PNG_PTR is a pointer to the PNG control structure. Copy LENGTH
+ bytes from the input to DATA. */
+
+static void
+png_read_from_file (png_ptr, data, length)
+ png_structp png_ptr;
+ png_bytep data;
+ png_size_t length;
+{
+ FILE *fp = (FILE *) fn_png_get_io_ptr (png_ptr);
+
+ if (fread (data, 1, length, fp) < length)
+ fn_png_error (png_ptr, "Read error");
+}
+
+
/* Load PNG image IMG for use on frame F. Value is non-zero if
successful. */
@@ -5896,5 +5910,5 @@
fn_png_set_read_fn (png_ptr, (void *) &tbr, png_read_from_memory);
else
- fn_png_init_io (png_ptr, fp);
+ fn_png_set_read_fn (png_ptr, (void *) fp, png_read_from_file);
fn_png_set_sig_bytes (png_ptr, sizeof sig);