Content-Type Examples

Newer browsers such as Arena support Content-Type negotiation with newer servers such as Apache. The experimental Arena 0.97 arena-linux.bin.gz shows a preference for JPEG, as follows:
 image/x-xbitmap; q=0.6
 image/x-xpixmap; q=0.6
 image/jpeg; q=0.8
 image/gif; q=0.6
 text/plain; q=0.4
These preferences are multiplied by the server's preferences, set in the .var file, to decide which file is served.

If you use the experimental Arena, which prefers JPEG, you will see two JPEGs below. If you are using a browser which ignores the quality qualifier, you will see one JPEG and one GIF. Note: earlier versions of Arena did not prefer JPEG to GIF. The quality value could be overridden in your .mailcap file, but at the expense of spawning an external viewer


This image uses the type-map mechanism in Apache httpd.
It uses this .var file to preferentially serve a JPEG image with q=0.7 cf. GIF with q=0.6.


This image uses the type-map mechanism in Apache httpd.
It uses this .var file to preferentially serve a GIF file with q=0.7 cf. JPEG with q=0.6.

Warning: Content-Type negotiation is still experimental, and may produce strange results. There is, as far as I know, no way to differentiate between preferences for files displayed by the browser and files displayed by an external viewer, so you might end up getting an external GIF instead of a JPEG because your browser could not display inline JPEG.

Languages

Content-Type negotiation may also be used to preferentially serve files in different natural languages, different encoding schemes, or with different lengths.

Back to Image Tips.


Vancouver Webpages