Commit c6892044 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(tiff_error_handler, tiff_warning_handler): New functions.

(tiff_load): Install them as error and warning handler.
parent c86350b1
......@@ -9474,6 +9474,34 @@ tiff_size_of_memory (data)
}
static void
tiff_error_handler (title, format, ap)
const char *title, *format;
va_list ap;
{
char buf[512];
int len;
len = sprintf (buf, "TIFF error: %s ", title);
vsprintf (buf + len, format, ap);
add_to_log (buf, Qnil, Qnil);
}
static void
tiff_warning_handler (title, format, ap)
const char *title, *format;
va_list ap;
{
char buf[512];
int len;
len = sprintf (buf, "TIFF warning: %s ", title);
vsprintf (buf + len, format, ap);
add_to_log (buf, Qnil, Qnil);
}
/* Load TIFF image IMG for use on frame F. Value is non-zero if
successful. */
......@@ -9497,6 +9525,9 @@ tiff_load (f, img)
file = Qnil;
GCPRO1 (file);
TIFFSetErrorHandler (tiff_error_handler);
TIFFSetWarningHandler (tiff_warning_handler);
if (NILP (specified_data))
{
/* Read from a file */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment