gzipped images in SIAP 1.0

Norman Gray norman at astro.gla.ac.uk
Tue May 22 08:44:35 PDT 2007


Roy, hello.

[I'm responding from memory -- I can find chapter in verse in RFC  
2616 if you need it]

On 2007 May 22 , at 17.20, Roy Williams wrote:

> -- If somehow the answer is yes, that gzipped images *can* be returned
>    by a SIAP, can somebody recommend a MIME type to use?    Would  
> it be application/x-gzip?

It should be served as image/fits, with or without a content-encoding  
of gzip.  If the content-encoding header is present in the response,  
then the implication is that the client should transparently unzip  
it.  [If you wanted to distribute a gzip file -- ie, the client is  
neither expected nor permitted to _transparently_ unzip it -- then  
you'd use application/x-gzip, or whatever the appropriate MIME type  
for a zipped file is; but that's not what you want, I don't think].   
There is probably an accept-encodings request header, though I can't  
remember for definite.

> -- Does the client need to parse the URL? (i.e. look for ending in
>    .fits.gz or .fit.gz or .FITS.gz or all the other combinations)

No.  If the client does this then it's violating HTTP; the only  
exception is where there is no MIME type (a protocol violation, I  
think), in which case the client is allowed to start guessing.  That  
is, if you dereference a URL which ends .jpeg.gz, and I send it back  
with a MIME type of image/fits, then it's a FITS file you parse it as.

> -- Does anyone remeber the intention of the comma-delimited list of  
> MIME types?    

In an Accept request header, it's a list of MIME types the client is  
prepared to accept.  If the 'q' parameter is present (eg, `Accept:  
image/fits,image/jpeg;q=0.9', with the default being q=1.0), then it  
specifies a list of client preferences, so that the server is  
expected (or required, I can't remember) to return the type with the  
highest priority; if the parameter is absent, the list is unordered,  
and the server can return anything in the list it prefers.  There's  
no list in the Content-Type response header.

> -- Are there any other MIME types out there that my code should  
> check for?

Presumably it could do something sensible with application/fits, but  
I'm not the expert on that.

All the best,

Norman


-- 
------------------------------------------------------------------
Norman Gray  :  http://nxg.me.uk
eurovotech.org  :  University of Leicester, UK




More information about the dal mailing list