Index: trunk/psLib/src/jpeg/psImageJpeg.c
===================================================================
--- trunk/psLib/src/jpeg/psImageJpeg.c	(revision 7697)
+++ trunk/psLib/src/jpeg/psImageJpeg.c	(revision 7736)
@@ -140,4 +140,5 @@
     PS_ASSERT_INT_POSITIVE(strlen(filename), false);
 
+    float zero, scale;
     struct jpeg_compress_struct cinfo;
     struct jpeg_error_mgr jerr;
@@ -177,6 +178,11 @@
     psU8 *Bpix = map->blue->data.U8;
 
-    float zero = min;
-    float scale = 256.0/(max - min);
+    if (max == min) {
+        zero = min - 0.1;
+        scale = 256.0/0.2;
+    } else {
+        zero = min;
+        scale = 256.0/(max - min);
+    }
 
     for (int j = 0; j < image->numRows; j++) {
