Index: /trunk/psLib/src/imageops/psImageBackground.c
===================================================================
--- /trunk/psLib/src/imageops/psImageBackground.c	(revision 11155)
+++ /trunk/psLib/src/imageops/psImageBackground.c	(revision 11156)
@@ -7,4 +7,5 @@
 
 #include "psMemory.h"
+#include "psTrace.h"
 #include "psImage.h"
 #include "psVector.h"
@@ -98,4 +99,10 @@
         }
         if (!psVectorStats (stats, values, NULL, NULL, 0)) {
+            if (psTraceGetLevel("psLib.imageops") >= 5) {
+                FILE *f = fopen ("vector.dat", "w");
+                int fd = fileno(f);
+                p_psVectorPrint (fd, values, "values");
+                fclose (f);
+            }
             psError(PS_ERR_UNKNOWN, false, "Unable to measure statistics for image background "
                     "(%dx%d, (row0,col0) = (%d,%d)",
@@ -104,4 +111,10 @@
             return false;
         }
+        if (psTraceGetLevel("psLib.imageops") >= 6) {
+            FILE *f = fopen ("vector.dat", "w");
+            int fd = fileno(f);
+            p_psVectorPrint (fd, values, "values");
+            fclose (f);
+        }
     }
 
