From 08fa28d6f960c03863daf304fd3be3b35920242e Mon Sep 17 00:00:00 2001 From: Rupert Date: Mon, 18 Nov 2024 21:50:48 +0100 Subject: [PATCH] plug-ins: avoid log-spamming by sgi plug-in last log I checked had ~12.000 'sgiGetRow...' msgs --- plug-ins/file-sgi/sgi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plug-ins/file-sgi/sgi.c b/plug-ins/file-sgi/sgi.c index cc7dd2e401..d5e440ecbd 100644 --- a/plug-ins/file-sgi/sgi.c +++ b/plug-ins/file-sgi/sgi.c @@ -297,6 +297,7 @@ load_image (GFile *file, tile_height, /* Height of tile in GIMP */ count, /* Count of rows to put in image */ bytes; /* Number of channels to use */ + gboolean errprinted; /* flag to avoid spamming logfile */ sgi_t *sgip; /* File pointer */ GimpImage *image; /* Image */ GimpLayer *layer; /* Layer */ @@ -485,6 +486,7 @@ load_image (GFile *file, * Load the image... */ + errprinted = FALSE; for (y = 0, count = 0; y < sgip->ysize; y ++, count ++) @@ -501,9 +503,12 @@ load_image (GFile *file, } for (i = 0; i < sgip->zsize; i ++) - if (sgiGetRow (sgip, rows[i], sgip->ysize - 1 - y, i) < 0) - g_printerr ("sgiGetRow(sgip, rows[i], %d, %d) failed!\n", - sgip->ysize - 1 - y, i); + if (sgiGetRow (sgip, rows[i], sgip->ysize - 1 - y, i) < 0 && ! errprinted) + { + g_printerr ("sgiGetRow(sgip, rows[i], %d, %d) failed!\n", + sgip->ysize - 1 - y, i); + errprinted = TRUE; + } if (sgip->bpp == 1) {