Index: trunk/psLib/src/fits/psFitsImage.c
===================================================================
--- trunk/psLib/src/fits/psFitsImage.c	(revision 18869)
+++ trunk/psLib/src/fits/psFitsImage.c	(revision 19270)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-08-02 02:50:41 $
+ *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-08-29 01:01:39 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -624,9 +624,10 @@
 
     if (blank != 0 && bitPix > 0) {
-        // Some quantisation has taken place --- record the blank ("magic") pixel value
-        char *keyword = (psFitsCompressionGetType(fits) != PS_FITS_COMPRESS_NONE &&
-                         (!fits->options || fits->options->conventions.compression)) ?
-            "ZBLANK" : "BLANK";         // Keyword for recording blank pixel value
-        fits_write_key_lng(fits->fd, keyword, blank, "Value for undefined pixels", &status);
+        // Some quantisation has taken place --- record the blank ("magic") pixel value.
+        //
+        // According to http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/compress/compress_image.html,
+        // the keyword is "BLANK" when BITPIX > 0, and "ZBLANK" when BITPIX < 0.  Since we do our
+        // own quantisation, the correct keyword is always "BLANK" instead of "ZBLANK".
+        fits_write_key_lng(fits->fd, "BLANK", blank, "Value for undefined pixels", &status);
         fits_set_imgnull(fits->fd, blank, &status);
         if (psFitsError(status, true, "Could not write BLANK header to file.")) {
