(tiff_error_handler, tiff_warning_handler): New functions.
(tiff_load): Install them as error and warning handler.
This commit is contained in:
parent
c86350b15d
commit
c689204496
1 changed files with 31 additions and 0 deletions
31
src/xfns.c
31
src/xfns.c
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue