# HG changeset patch # User Gerd Moellmann # Date 1002280977 0 # Node ID 84263f0294b3fc00fd851287b6777a3f6d45edd6 # Parent b7761d10bdc59b55e49357868693f1aed62502f1 (tiff_error_handler, tiff_warning_handler): New functions. (tiff_load): Install them as error and warning handler. diff -r b7761d10bdc5 -r 84263f0294b3 src/xfns.c --- a/src/xfns.c Fri Oct 05 10:40:42 2001 +0000 +++ b/src/xfns.c Fri Oct 05 11:22:57 2001 +0000 @@ -9474,6 +9474,34 @@ } +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 @@ file = Qnil; GCPRO1 (file); + TIFFSetErrorHandler (tiff_error_handler); + TIFFSetWarningHandler (tiff_warning_handler); + if (NILP (specified_data)) { /* Read from a file */