(tiff_error_handler, tiff_warning_handler): New functions.

(tiff_load): Install them as error and warning handler.
This commit is contained in:
Gerd Moellmann 2001-10-05 11:22:57 +00:00
parent c86350b15d
commit c689204496

View file

@ -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 */