about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2008-12-28 16:24:42 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2008-12-28 16:24:42 +0000
commit9d558114b4dc863311ca9005be231cb809455bc5 (patch)
tree23e11e4281b40336e45544f35c8d02867797d53d
parent588ca3671e258b8381e0404d81668b0d828b362d (diff)
downloadnetpbm-mirror-9d558114b4dc863311ca9005be231cb809455bc5.tar.gz
netpbm-mirror-9d558114b4dc863311ca9005be231cb809455bc5.tar.xz
netpbm-mirror-9d558114b4dc863311ca9005be231cb809455bc5.zip
Add comments
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@795 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/fitstopnm.c13
-rw-r--r--converter/other/pamtofits.c14
2 files changed, 27 insertions, 0 deletions
diff --git a/converter/other/fitstopnm.c b/converter/other/fitstopnm.c
index 86bdfbb8..9df47be3 100644
--- a/converter/other/fitstopnm.c
+++ b/converter/other/fitstopnm.c
@@ -30,6 +30,12 @@
  ** disabled min max scanning when reading from stdin.
  */
 
+/*
+  The official specification of FITS format (which is for more than
+  just visual images) is at
+  ftp://legacy.gsfc.nasa.gov/fits_info/fits_office/fits_standard.pdf
+*/
+
 #include <string.h>
 #include <float.h>
 
@@ -507,6 +513,13 @@ convertPgmRaster(FILE *             const ifP,
                  double             const datamin,
                  xel **             const xels) {
         
+    /* Note: the FITS specification does not give the association between
+       file position and image position (i.e. is the first pixel in the
+       file the top left, bottom left, etc.).  We use the common sense,
+       popular order of row major, top to bottom, left to right.  This
+       has been the case and accepted since 1989, but in 2008, we discovered
+       that Gimp and ImageMagick do bottom to top.
+    */
     unsigned int image;
 
     pm_message("writing PGM file");
diff --git a/converter/other/pamtofits.c b/converter/other/pamtofits.c
index 04b43c35..7a71ff56 100644
--- a/converter/other/pamtofits.c
+++ b/converter/other/pamtofits.c
@@ -20,6 +20,12 @@
 ** in the FITS header, but do not cause the data to be rescaled.
 */
 
+/*
+  The official specification of FITS format (which is for more than
+  just visual images) is at
+  ftp://legacy.gsfc.nasa.gov/fits_info/fits_office/fits_standard.pdf
+*/
+
 #include <assert.h>
 #include <string.h>
 #include <stdio.h>
@@ -201,6 +207,14 @@ writeRaster(struct pam * const pamP,
             unsigned int const bitpix,
             int          const offset) {
 
+    /* Note: the FITS specification does not give the association between
+       file position and image position (i.e. is the first pixel in the
+       file the top left, bottom left, etc.).  We use the common sense,
+       popular order of row major, top to bottom, left to right.  This
+       has been the case and accepted since 1989, but in 2008, we discovered
+       that Gimp and ImageMagick do bottom to top.
+    */
+
     unsigned int plane;
 
     for (plane = 0; plane < pamP->depth; ++plane) {