Subject: Forcing files to not be displayed.

From: William Thompson <William.T.Thompson.1 at gsfc.nasa.gov>
Date: 10 Nov 1994 20:29:15 GMT

Does anyone know a way to set up a .mailcap file so that
programs such as Mosaic, Netscape, etc. will simply download
the file instead of trying to display it?  For example, it
seems to be very popular in the FITS community to use the MIME
type "image/x-fits" for FITS files.  On most systems the
default for anything marked as an image is to run a generic
program, such as xv or lview, that works with GIF and JPEG
files and the like.  However, this may not be the appropriate
thing to do with FITS files, and the user may not have a FITS
viewer.

I know that using "application/x-fits" does make Mosaic, etc.
download the file as binary rather than trying to display it.
However, it does make sense to distinguish those FITS files
that are simple images so that those who do have the proper
software can simply pop up the images directly.  What I'm
looking for is something simple that people can do to avoid
calling xv or whatever if they don't have a proper FITS
viewer.

I tried simply putting the line

	image/x-fits;

in my .mailcap file, but that didn't work.

Bill Thompson

---

From: Lucio Chiappetti <lucio at ifctr.mi.cnr.it>
Date: Fri, 11 Nov 1994 16:37:01 +0100 (MET)

> calling xv or whatever if they don't have a proper FITS
  I do not know of anything which can be done at the server end,
  but at the user end, the user may click on "Load to Local Disk"
  in the Options menu.
  I presume this can also be set as a default via X resources.

  What I did when I had some "funny" files (VMS Backups compressed
  with a VMS specific code) to make available via WWW, was to put
  some warnings in the page with the URLs, saying : to upload those,
  click on Load to Local Disk first.

---------------------------------------------------------------------------- 
       A member of  G.ASS : Group for Astronomical Software Support          
---------------------------------------------------------------------------- 
Lucio Chiappetti - IFCTR/CNR     | Ma te' vugl' da' quost avis a ti' Orsign  
via Bassini 15 - I-20133 Milano  | Buttet rabios intant te se' pisnign       
Internet: LUCIO at IFCTR.MI.CNR.IT  |                                           
Decnet:   IFCTR::LUCIO           |             (Rabisch, II 46, 119-120)     
----------------------------------------------------------------------------

---

From: pmurphy at nrao.edu (Patrick P. Murphy)
Date: 15 Nov 1994 03:42:40 GMT

In article <39tvqr$388 at paperboy.gsfc.nasa.gov>, William Thompson
   <William.T.Thompson.1 at gsfc.nasa.gov> writes: 

WT> Does anyone know a way to set up a .mailcap file so that
WT> programs such as Mosaic, Netscape, etc. will simply download
WT> the file instead of trying to display it?  For example, it
WT> seems to be very popular in the FITS community to use the MIME
WT> type "image/x-fits" for FITS files.  On most systems the
WT> default for anything marked as an image is to run a generic
WT> program, such as xv or lview, that works with GIF and JPEG
WT> files and the like.  However, this may not be the appropriate
WT> thing to do with FITS files, and the user may not have a FITS
WT> viewer.

There is a patch available to xv that permits it to read and write FITS
files.  Granted it's probably not capable of digesting, say, a UV database
from AIPS, but for most FITS images it seems to work reasonably well.  I
have a copy of it on my anonymous ftp server orangutan.cv.nrao.edu
[192.33.115.11] in /pub/aips/xv/FITS-v2.tar.Z.  I've used this to patch
both xv versions 2 and 3 successfully.

Were you to have this, it would then be possible to view the image by
clicking on the URL/link, viewing it in xv, and then using xv's save
function to save it to a local disk.  I have not used this mode of
operation extensively, and it's not at all clear how much of the header
would be preserved beyond the bare essentials, but it's a start.  If you
just want "pretty pictures" it's definitely a good method.

Another option would be to use the .mailcap to specify:

image/fits; saoimage %s

Sorry, I don't know how to make the system recognise a binary file,
though I'm sure it's possible.

				- Pat
--
=============================================================================
  Patrick P. Murphy, Ph.D.                   Scientific Programming Analyst
  National Radio Astronomy Observatory                     pmurphy at nrao.edu
  520 Edgemont Road                                     Tel: (804) 296-0372
  Charlottesville, VA 22903-2475                        Fax: (804) 296-0278
  Speaking only for himself.                        PGP key, URL on request
=============================================================================

---

From: drtr at mail.ast.cam.ac.uk (David Robinson)
Date: 15 Nov 1994 11:19:37 GMT

>both xv versions 2 and 3 successfully.

If you are using OSF/1 and these patches, then you should use a slightly
later version of these patches, which has a tiny change. The newer version
is on ftp-hst.ast.cam.ac.uk:/pub/software/xv-patches/FITS-v2.tar.Z, or
you can apply the patch at the end of this message. If you are not running
OSF/1, then the version at nrao is ok, and may be quicker to fetch from within
the USA.

>...

In the past, the author of xv has said that the 'next' version will support
FITS files. However, I recently mailed the author telling him of the interest
here in displaying FITS files via WWW, and asking him whether FITS would be
supported in xv-3.10; I've had no response.

 David Robinson. (drtr at mail.ast.cam.ac.uk)

--------- begin file: patch to xvfits.c from nrao for OSF/1 ------------------
*** xvfits.c.nrao	Wed Jan 19 17:26:56 1994
--- xvfits.c	Tue May  3 13:07:50 1994
***************
*** 38,47 ****
--- 38,49 ----
  /* end static data */

+ #ifndef __
  #ifdef __STDC__
  #define __(x) x
  #else
  #define __(x) ()
+ #endif
  #endif
  
  static int splitfits __((byte *image, char *comment, int nx, int ny, int nz,
------------ end file: patch to xvfits.c from for OSF/1 --------------------

---

From: pmurphy at nrao.edu (Patrick P. Murphy)
Date: 22 Nov 1994 16:05:22 GMT

In article <3aa5g9$2a8 at lyra.csx.cam.ac.uk>, drtr at mail.ast.cam.ac.uk (David
   Robinson) writes: 

DR> In article <PMURPHY.94Nov14224240 at orangutan.cv.nrao.edu>
DR> pmurphy at nrao.edu (Patrick P. Murphy) writes: 

PM> There is a patch available to xv that permits it to read and write FITS
    ...

DR> If you are using OSF/1 and these patches, then you should use a slightly
DR> later version of these patches, which has a tiny change. The newer version

Thanks.  I've updated the copy of xvfits.c in the version here too, so if
people on this continent want to get the revised version, they don't have
to cross the Atlantic...
				- Pat
--
=============================================================================
  Patrick P. Murphy, Ph.D.                   Scientific Programming Analyst
  National Radio Astronomy Observatory                     pmurphy at nrao.edu
  520 Edgemont Road                                     Tel: (804) 296-0372
  Charlottesville, VA 22903-2475                        Fax: (804) 296-0278
  Speaking only for himself.                        PGP key, URL on request
=============================================================================