gzipped images in SIAP 1.0

Thomas McGlynn tam at milkyway.gsfc.nasa.gov
Tue May 22 08:02:45 PDT 2007


Steve Allen wrote:
> On Tue 2007-05-22T09:29:17 -0400, Thomas McGlynn hath writ:
>> Isn't it valid to refer to a compressed FITS file with the header:
>>
>>    Content-type: Image/FITS
>>    Content-encoding: GZIP
>>
>> That would seem to appropriately separate the semantics of the data from
>> the encoding.  I think we may do this in some of our on-line data at the
>> HEASARC.
> 
> Yes, but note that the HTTP header line is spelled
> Content-coding
> 
> That is as noted in the FITS RFC 4047.
> 
> It is as implemented in SAOimage ds9 for some five years.
> 

Hi Steve,

I don't think that's right.  The HTTP RFC
   http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html
has

3.5 Content Codings
  Content coding values indicate an encoding transformation that has been or can be applied to an entity. Content 
codings are primarily used to allow a document to be compressed or otherwise usefully transformed without losing the 
identity of its underlying media type and without loss of information. Frequently, the entity is stored in coded form, 
transmitted directly, and only decoded by the recipient.

        content-coding   = token

All content-coding values are case-insensitive. HTTP/1.1 uses content-coding values in the Accept-Encoding (section 
14.3) and Content-Encoding (section 14.11) header fields. Although the value describes the content-coding, what is more 
important is that it indicates what decoding mechanism will be required to remove the encoding.


When I first saw that I also thought it implied a content-coding header.
I had to read this a few times to understand the the line all by itself is simply saying that
the content-coding is some arbitrary token, e.g., the string "gzip.  It is not saying
that there is an HTTP header keyword content-coding.  The sentence
that begins "HTTP1.1 uses content-codings..." indicates that the HTTP header keywords where
these tokens are used are
    Content-encoding   and
    Accept-encoding

At least that's my reading of what's going on.  The content-encoding header is described in
detail in 14.11, which has no entry for content-coding.  Section 14 has no description
of a content-coding header.

	Tom



More information about the dal mailing list