This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit 66f39b6556eb1227f57fc3f931f8f0d6418199c9
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Wed Jan 3 20:02:07 2024 +0100

    TIFF loader: Properly suppress messages from libtiff
---
 src/modules/loaders/loader_tiff.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/modules/loaders/loader_tiff.c b/src/modules/loaders/loader_tiff.c
index ad05e0e..ae71ded 100644
--- a/src/modules/loaders/loader_tiff.c
+++ b/src/modules/loaders/loader_tiff.c
@@ -10,6 +10,16 @@ static const char *const _formats[] = { "tiff", "tif" };
 
 #define DD(fmt...)  DC(DBG_PFX, 0x80, fmt)
 
+static void
+_tiff_error(const char *module, const char *fmt, va_list ap)
+{
+#if IMLIB2_DEBUG
+    char            buf[128];
+    vsnprintf(buf, sizeof(buf), fmt, ap);
+    D("%s: %s: %s\n", __func__, module, buf);
+#endif
+}
+
 static struct {
     const unsigned char *data, *dptr;
     unsigned int    size;
@@ -364,6 +374,9 @@ _load(ImlibImage *im, int load_data)
 
     mm_init(im->fi->fdata, im->fi->fsize);
 
+    TIFFSetErrorHandler(_tiff_error);
+    TIFFSetWarningHandler(_tiff_error);
+
     tif = TIFFClientOpen(im->fi->name, "r", NULL, _tiff_read, _tiff_write,
                          _tiff_seek, _tiff_close, _tiff_size,
                          _tiff_map, _tiff_unmap);
@@ -470,6 +483,9 @@ _save(ImlibImage *im)
     int             i;
     ImlibImageTag  *tag;
 
+    TIFFSetErrorHandler(_tiff_error);
+    TIFFSetWarningHandler(_tiff_error);
+
     tif = TIFFFdOpen(fileno(im->fi->fp), im->fi->name, "w");
     if (!tif)
         return LOAD_FAIL;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to