Index: /branches/eam_branches/ipp-20100823/psLib/src/jpeg/psImageJpeg.c
===================================================================
--- /branches/eam_branches/ipp-20100823/psLib/src/jpeg/psImageJpeg.c	(revision 29354)
+++ /branches/eam_branches/ipp-20100823/psLib/src/jpeg/psImageJpeg.c	(revision 29355)
@@ -49,4 +49,5 @@
 psImageJpegOptions *psImageJpegOptionsAlloc(void)
 {
+
   psImageJpegOptions *options = psAlloc(sizeof(psImageJpegOptions));
   psMemSetDeallocator(options, (psFreeFunc)imageJpegOptionsFree);
@@ -194,6 +195,18 @@
 }
 
+bool sprint_double (char *string, double value) {
+
+  int Nexp = fabs(log10(fabs(value)));
+  
+  if (Nexp > 3) {
+    sprintf (string, "%.1e", value);
+  } else {
+    sprintf (string, "%.1f", value);
+  }
+  return true;
+}
+
 // XXX need to update bDraw APIs to pass in/out structure and avoid the local static 
-bool psImageJpeg(const psImageJpegOptions *options, const psImage *image, bDrawBuffer *bdbuf, const char *filename)
+bool psImageJpeg(const psImageJpegOptions *options, const psImage *image, void *bdbuf, const char *filename)
 {
   PS_ASSERT_PTR_NON_NULL(options, false);
@@ -327,9 +340,9 @@
     SetRotFont ("helvetica", 8);
     bDrawSetBuffer(labels);
-    sprintf (string, "%g", options->min);
+    sprint_double (string, options->min);
     bDrawRotText(2, 2, string, 2, 0.0);
-    sprintf (string, "%g", options->max);
+    sprint_double (string, options->max);
     bDrawRotText(dx - 2, 2, string, 0, 0.0);
-    sprintf (string, "%g", 0.5*(options->min + options->max));
+    sprint_double (string, 0.5*(options->min + options->max));
     bDrawRotText(0.5*dx, 2, string, 1, 0.0);
     psImageJpegOverlayDraw(jpegImage, labels, 0, offset);
@@ -338,5 +351,5 @@
   if (bdbuf) {
     offset = (options->showScale == PS_JPEG_SHOWSCALE_TOP) ? PS_JPEG_COLORPAD + PS_JPEG_LABELPAD : 0;
-    psImageJpegOverlayDraw(jpegImage, bdbuf, 0, offset);
+    psImageJpegOverlayDraw(jpegImage, (bDrawBuffer *) bdbuf, 0, offset);
   }
 
Index: /branches/eam_branches/ipp-20100823/psLib/src/jpeg/psImageJpeg.h
===================================================================
--- /branches/eam_branches/ipp-20100823/psLib/src/jpeg/psImageJpeg.h	(revision 29354)
+++ /branches/eam_branches/ipp-20100823/psLib/src/jpeg/psImageJpeg.h	(revision 29355)
@@ -53,9 +53,9 @@
 bool psImageJpeg(const psImageJpegOptions *options, // Color map
                  const psImage *image,  // Image to write
-		 bDrawBuffer *bdbuf, 
+		 void *bdbuf, 
                  const char *filename  // Filename of JPEG
 		 );
 
-bDrawBuffer *psImageJpegOverlayInit (const psImage *image);
+// bDrawBuffer *psImageJpegOverlayInit (const psImage *image);
 
 /// @}
Index: /branches/eam_branches/ipp-20100823/psLib/src/pslib.h
===================================================================
--- /branches/eam_branches/ipp-20100823/psLib/src/pslib.h	(revision 29354)
+++ /branches/eam_branches/ipp-20100823/psLib/src/pslib.h	(revision 29355)
@@ -17,5 +17,4 @@
 #define PS_LIB_H
 
-#include <kapa.h>
 #include "pslib_strict.h"
 
