Help Search Campus Map Directories Webmail Home Alumnae Academics Admission Athletics Student Life Offices & Services Library & Technology News & Events About the College Navigation Bar
MHC Home Using the Document Interface

The .IMG Command

Syntax: .IMG [IsMap] [GIF=] [JPG=] [PJPG=] [IMG tag info]

When the Document Interface runs, it actually knows some things about who is looking at the document. One thing it is able to do is decide what type of graphic files the browser supprts. This command allows you to create a single document which uses multiple versions of the same graphic, and have the DI decide which one suits the browser being used.

The three formats supported by this command are GIF, JPEG, and Progressive JPEG. They use the command parameters named GIF, JPG, and PJPG, respectively. The parameter IsMap is identical to the ISMAP option in the HTML IMG tag; it indicates the presence of a server-side image map. Additional IMG tag elements such as WIDTH, HEIGHT, and ALT may also be added to the .IMG command.

If a PJPG is specified and the browser supports it, this method is used. Preference then goes to JPG, and then finally GIF. If the browser does not support images at all, only the contents of the ALT element are displayed. If there is no ALT element, the word [Image] is displayed. For example:

GIF or nothing<BR>
<!--.img gif="imggif.gif" width=275 height=92 alt="Text Only"-->
<P>JPEG or GIF<BR>
<!--.img gif="imggif.gif" jpg="imgreg.jpg" width=275 height=92 alt="Text Only"-->
<P>Progressive JPEG, JPEG, or GIF<BR>
<!--.img gif="imggif.gif" jpg="imgreg.jpg" pjpg="imgprog.jpg" width=275 height=92 alt="Text Only"-->

GIF or nothing
Text Only

JPEG or GIF
Text Only

Progressive JPEG, JPEG, or GIF
Text Only

Here is an all-or-nothing example. You may have to hit your browser's Reload button to see the progressive display:

<!--.img pjpg="imgbigprog.jpg" width=464 height=315
         alt="Sorry, you need to use a browser that supports progressive JPEGs"-->

Sorry, you need to use a browser that supports progressive JPEGs

The easiest way to use the .IMG command is to start by creating and testing the page using the normal <IMG> tag. Then, once you are satisfied with the way the page looks, change the tag to the .IMG command; change the SRC element to the appropriate parameter name and add any new file formats:

<IMG src="foo.gif" width=275 height=92 alt="Description">

becomes...

<!--.img gif="foo.gif" jpg="foo.jpg" width=275 height=92 alt="Description"-->

----------------------------------------

Home | Directories | Web Email | Calendar | Campus Map | Search | Help

About the College | Admission | Academics | Student Life | Athletics
Offices & Services | Giving | News & Events | Alumnae | Library & Technology

Copyright © 1998 Mount Holyoke College. This page created by the OIS Operations Group and maintained by Webmaster. Last modified on March 31, 1998.