diff --git a/plug-ins/file-tiff/file-tiff-io.c b/plug-ins/file-tiff/file-tiff-io.c index 8e282a1e68..ac4f92530e 100644 --- a/plug-ins/file-tiff/file-tiff-io.c +++ b/plug-ins/file-tiff/file-tiff-io.c @@ -163,6 +163,8 @@ tiff_reset_file_size_error (void) tiff_file_size_error = FALSE; } +static gint max_msgs_per_instance = 3; + static void tiff_io_warning (const gchar *module, const gchar *fmt, @@ -170,6 +172,11 @@ tiff_io_warning (const gchar *module, { gint tag = 0; + if (max_msgs_per_instance > 0) + max_msgs_per_instance--; + else + return; + /* Between libtiff 3.7.0beta2 and 4.0.0alpha. */ if (! strcmp (fmt, "%s: unknown field with tag %d (0x%x) encountered") || /* Before libtiff 3.7.0beta2. */ @@ -280,6 +287,11 @@ tiff_io_error (const gchar *module, { gchar *msg; + if (max_msgs_per_instance > 0) + max_msgs_per_instance--; + else + return; + /* Workaround for: http://bugzilla.gnome.org/show_bug.cgi?id=132297 * Ignore the errors related to random access and JPEG compression */