From 8f169eb61cab4eaf89b34dfd76b6431e3acc8468 Mon Sep 17 00:00:00 2001 From: Jacob Boerema Date: Tue, 23 Aug 2022 16:15:59 -0400 Subject: [PATCH] plug-ins: fix #8467 "incorrect value RichTIFFIPTC" when loading TIFF ... created by Adobe Lightroom 5.1 Adobe products are known to write incorrect RichTIFFIPTC tags in TIFF images. Since libtiff correctly detects and handles this there is no real need for end users to be warned. So instead of a warning we will only output a message to stderr. (cherry picked from commit 0ad54f863a6e5837693777ae2c64c921e0e4759f) --- plug-ins/file-tiff/file-tiff-io.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plug-ins/file-tiff/file-tiff-io.c b/plug-ins/file-tiff/file-tiff-io.c index 0f5056f7d1..818556bed8 100644 --- a/plug-ins/file-tiff/file-tiff-io.c +++ b/plug-ins/file-tiff/file-tiff-io.c @@ -204,6 +204,28 @@ tiff_io_warning (const gchar *module, va_end (ap_test); } + else if (! strcmp (fmt, "Incorrect value for \"%s\"; tag ignored")) + { + va_list ap_test; + const char *stag; + + G_VA_COPY (ap_test, ap); + + stag = va_arg (ap_test, const char *); + + if (! strcmp (stag, "RichTIFFIPTC")) + { + gchar *msg = g_strdup_vprintf (fmt, ap); + + /* This is an error in Adobe products. Just report to stderr. */ + g_printerr ("[%s] %s\n", module, msg); + g_free (msg); + + return; + } + + va_end (ap_test); + } /* Workaround for: http://bugzilla.gnome.org/show_bug.cgi?id=131975 * Ignore the warnings about unregistered private tags (>= 32768).