NakedEye A SuperVga GIF viewer Version 1.10 Van Dao Mai Wollongong University June 1992 1.1 Acknowledgments I think it is always the work of somebody else that makes your work worth doing. That is why I wish to acknowledge the good work of Jordan Hargrave (for a SuperVGA BGI driver) and Gershon Elber (a GIFLIB library) for their excellent work. The SVGA256 BGI driver written by Jordan for the Borland compilers is truly superb. On the other hand, the GIF library written by Gershon is impressive and so easy to use. I created this software NakedEye Version 1.10 relying on the two software items mentioned above and found them extremely useful. 1.2 What does NakedEye 1.10 offer ? This GIF viewer is designed to work and make the most of what a small architecture like that of a PC can offer, typically 64K memory segments and a maximum of 640K of conventional memory. To work within this restricted environment, the amount of memory the GIF viewer needs is 1K of conventional memory for each opened image. This 1.5K is used mainly for the colour table, and the rest of the image is either in EMS (Expanded Memory LIM 4.#) or XMS memory or in a hard disk buffer. It has been tested to run well under OS/2 v2.0 DOS emulation in full screen mode. This GIF viewer is a pure SuperVGA GIF viewer, it does not understand anything less than the resolution 640x400 (this is actually a lie, it does know 320x200, but I hate this low resolution). The BGI (Borland Graphics Interface) driver by Jordan knows 640x480, 800x600 and 1024x678 in 256 colours. Thanks to the beautiful BGI driver, we have 256 colours for all resolutions of SuperVGA (it does not handle modes with less colours). Supports Resolutions : 640x400, 640x480, 800x600 and 1024x678. Supports 256 colours (out of 256K colours). Can open up to 200 GIF files (about 40-50 Mbytes) and be ready for very fast switching between them. Only 1.2 K is needed for each GIF picture in the conventional 640K memory and the rest is in EMS or/and hard disk. Automatically detect the idle time (when the user is looking at the current picture) and make use of it to decode the next image in advance. This method gives NakedEye a substantial speed advantage to many other popular GIF viewers. Provides automatic compression of the colour table to leave some colour entries for text and windows. Does not have any complicated installation or configuration, thanks to the BGI driver's ability to auto-detect the hardware type and handle it accordingly. Is almost totally mouse-driven and needs minimal key strokes. This is done using a POP-UP menu user interface extensively. Offers a simple music/sound association between GIF images and sound recorded in VOC format for the Sound Blaster card. Supports an on line catalogue of GIF images with reduced (passport photo size) image and large space for comments. Gives some limited capabilities to resize and save the images in GIF format. Provides a set of exotic features uniquely designed for the pleasure of the eyes. 1.3 Using NakedEye This GIF viewer is easy to use, all you have to do is to make sure that all its files are in one directory. If you run OS/2 v2.0 the best way to set up NakedEye is to create an icon to fire up a full screen DOS session with the optional argument point to your favourite GIF directory. You can also associate the .GIF file extension with NakedEye for the OS/2 file manager. The hardware requirement for this software to run is an IBM PC or compatible with a SuperVGA video card and a SuperVGA monitor. The video card must have at least 512K RAM for resolutions up to 800x600 in 256 colours, and definitely 1Mb RAM for the resolution 1024x768 in 256 colours. Here is the list of video cards supported by the SuperVGA graphics driver : Ahead, ATI, Chips & Tech, Everex, Paradise, Trident, Tseng (both 3000 and 4000 chipsets), Oak, and Video7. Experience shows that the Tseng family of cards work very well with NakedEye. At the DOS prompt type ne gif-files where gif-files is a list of GIF files (a wild card is accepted in each item of the list). If directories are given they will be scanned and all GIF files within them will be picked up. All the GIF file names will be sorted alphabetically. This first file will be displayed immediately. The rest will be loaded on demand and by the automatic loading feature which works when the CPU is idle. When Automatic loading is working, it is interrupted any time the user demands attention from the program. 1.4.1 The Control Panel Let's first look at a mouse technique, the mouse is seen as a big + sign. To select an area you find a suitable spot and press the leftmost button once, release it, go to another spot opposite to form a rectangle, then press the same button once again. The two points together help NakedEye to determine the size of a square area (the smaller side of the rectangle). This square area will be used as the active image area directly affected by the current command. The mouse click should be soft and quick to avoid being interpreted twice. All commands should explain themselves. In this version of NakedEye, some items on the ControlPanel has a sub-menu that pops up. Many commands are activated by the keyboard. Here is a list of keyboard commands. Here are some of the commands. Please use F1 to get the on-line help information with all key board commands. E exits to DOS (Exit). F switches ON/OFF full-screen mode (FullScr). I pops up a menu for image editing. N goes to next image (Next). P shows the Puzzle (Puzzle). R restores the colour and redraws the image (Restore). T toggles background/foreground colour. U increases the magnification factor by 1. V pops up a menu for selecting VGA modes W writes the images out (Save). F1 shows a help window. F2 does a slide show (Show'em). F3 pops up a menu for selecting a delay in seconds between images in a slide show. F5 activates a VOC sound player. F8 generates PostScript output for the current image. F9 does shell ESCape to DOS (SHELL). F10 toggles ON/OFF the idle time detection and automatic next-image-decoding running in the background. ESC stops the current command or exit back to DOS if no command is running. HOME shows the top-left corner of the current image. LEFT shifts the image left gradually. UP shifts the image up gradually. DOWN shifts the image down gradually. RIGHT shifts the image right gradually. CTRL-S saves the gif file (Save). CTRL-I activates the IMAGE sub-menu CTRL-F activates the FILE sub-menu. CTRL-D dumps the screen. The only portion that fits into the window is dumped out in GIF format. This is very similar to Save but the source is the screen. The output file is "eye#.gif" where # is a number. Please note that LEFT, DOWN, UP and RIGHT are the arrow keys. You can control the scrolling of the image using these keys. If you are in KeyBoard mouse mode (or you do not have a mouse) the keys are used for the KeyBoard Mouse, therefore not available for scrolling the image. The keys PGUP and PGDN are still available. The command Scroll on the Control Panel is always available for the purpose. You may have noted that the magnification factor you get from the keyboard is not the same as the one on the control panel. The keyboard is for the whole image whilst the magnification from the panel is for the real-time magnifying glass, the convex and concave mirrors. The current command can be stopped by the ESC key or at other situations, by holding the leftmost mouse button down (mouse-related commands) 1.4.2 Other weird features There are a couple of weird features that can be invoked from the keyboard. When NakedEye is waiting for your command the two keys J and K are used to change the colour of the mouse. The mouse has its colour from the colour table of the current GIF image. Sometimes the mouse is hard to see and the keys can be used to change it. Initially the colour of the mouse is set to the last colour index in the colour table. When you are in the shifting mode where the whole image drifts slowly, the current image is drifting up/down or left/right depending on what arrow key was used. The arrow keys are also used to slow the speed down or increase it depending upon in what direction the image is drifting. Simply do some experiments with them and you will see that they are intuitive enough. You will also notice that the keys U and D are used for instant magnification and reduction of the current image. The way they work are through duplicating pixels, and this means the image will be blown up by 2, 3, 4 ... times the original size. NakedEye limits the magnification factor to 10, but it also offers a magnification factor of 0.5. This causes 50 of the pixels to be skipped in both directions and effectively reduces the image by half each side. It is the only way to bring huge images (about 1500x1500) into the SuperVGA screen instantly without the huge overhead of scaling. But as soon as you are ready to do something else, NakedEye will return the image back to the original size, then continue to do what you command it to do. 1.5 What else do you need to know ? This copy of the software is offered for free (unregistered copy) without warranty of any kind. If you are happy with the unregistered copy and its slightly restricted functionality, you are welcome to use it. However if you would like to have a fully functional copy of NakedEye you should register. More information will be given later, especially if you support an environmental organisation you are more than welcomed to have a registered copy for free. NakedEye has been tested extensively, and no obvious bugs are known. There may be a minor problem with the SuperVGA graphics driver. The BGI driver of Jordan crashes on some video cards if you try to select the video mode that your hardware does not support. On some good video cards the driver will be able to come back and complain. I cannot handle the case when it crashes. The machine will have to be rebooted. To avoid this situation, you can explicitly tell NakedEye about the video modes that your video card can handle (look at the file NakedEye.cfg). The variable resol in the file NakedEye.cfg can be set to the correct video modes. NakedEye does not handle interlaced GIF files. This is a limitation due to a trade-off in the design of the software to conserve core memory. NakedEye uses very little memory for each GIF file, and this makes it too hard for decoding interlaced GIF files. You have to convert interlaced GIF files into normal GIF files using some utility in the public domain. There are a couple of command line options that you can use to invoke NakedEye into a correct video resolution or avoid the automatic compression of the colour table. Here is the full DOS style synopsis : NE [-mRES] [-c] [-q] [-s] [-dSECS] [-ns] [-h] gif-files Or NE gif-files [/mRE] [/c] [/q] [/s] [/dSECS] [/ns] [-h] Gif-files is a list of GIF files or names with wild card or even directory names. The scanning process can take some time if you give NakedEye too many places to search for GIF files. Option -m is used to set the start-up resolution for the video card where RES is one of 320x200, 640x400, 640x480, 800x600 and 1024x768. To save you from typing such a long string, NakedEye also understands -0, -1, -2, -3 and -4 respectively. To start NakedEye up in 800x600, simply type ne -3 *.gif, for instance. Option -c tells NakedEye not to compress the colour table for each image. This is useful if you do not want to alter the images fearing some problem later when you may like to save them into new GIF files. I have not found any problems with compressing the colour table. The compression tends to leave a few empty colour entries behind to be used as colours for the Control Panel and text. Option -q is for quick display of a GIF file. When NakedEye sees this flag it will display the GIF file (or the first of many) straight away. The displaying of the LOGO is skipped (registered copy only). Option -s is for starting up a slide show. A slide show can be started up by option -q then the F2 key, but there will be users who want to save one extra key stroke. Option -d is used to set up a delay time value between each picture in a slide show of the GIF pictures where SECS is the amount of time in seconds. To get a slide show going, the typical method is to run NakedEye with a wild card to match all the desired GIF files and option -s for a quick start up straight into a slide show. NE -s -d5 *.gif The above command will start NakedEye and set it ready for you to have a slide show with 5 seconds delay between each image. I assume that you have all the desired GIF files in the current directory. Of course, at first the show will be much slower than 5 seconds between each image because a lot of time is needed to load (decode) the images into memory (and/or hard disk cache). Once all the GIF files have been decoded, the speed can be very fast depending on how much memory your machine has. Option -ns stops NakedEye from sorting the list of GIF files given to it. This may be what you desired so that you can manually arrange the images into a particular order. Perhaps you would have noticed that the DOS convention of option using the / character is also supported. The options can be placed anywhere on the command line even between the list of GIF files. NakedEye automatically discards all non-GIF formatted files if you use a wild card. The wild card "*" means everything that can be read. This is in fact the one I use myself all the time. There is also a configuration file called NakedEye.cfg for you to set the default start up for your PC. The sample file is self-explanatory with a lot of comments inside. Simply follow the comments and set it right for your system. The most probable item that you would set is the default start-up resolution. This should be set to the best resolution you have in your hardware. If you worry about speed, also set the swap buffer file's path to your fastest hard drive. In case you do not have a memory manager LIM 4.# installed, but you have a large ram disk installed, then go for it! - set the path of the swap file to this ram disk to make swapping a lot faster. Please read the section Configuring NakedEye if you plan to tune NakedEye to your taste. If NakedEye crashes due to some system exception trap, the EMS memory may not be freed, and this means the machine has to be rebooted to get the EMS memory functional again. This is inevitable for this kind of situation. To reduce the chance that this happens, please do not use Ctrl-C or Ctrl-Break to break the program unless you are desperate to do so, and also do not to switch to the video modes that your hardware cannot handle. In any problematic case hit the ESC key and wait for NakedEye to complete what it is doing and exits cleanly. In case of crashes you should look for a file called buffer#.tmp in your disk and delete it as that is the swap file used for buffering the decoded GIF images. The software is designed to handle up to 50 Mbytes of GIF files in a session, therefore the swap buffer file can be very large. If you use commands that will alter the actual size of the image NakedEye will have to performed a lot of disk I/O because it is designed to conserve memory. It will create temporary files for swapping. These files all have the .tmp extensions to make it easy for you to identified and delete them if the system crashes. It is a good idea to set the variable bufpath in nakedeye.cfg to the fastest hard disk you have, and make it point to a directory that is used mainly for temporary files that can be removed any time. For example, if you have drive C: as the fastest drive (and/or it has a lot of free disk space), the bufpath should be set to c:\tmp. Then you create c:\tmp to accommodate all the temporary files. If you have a large RAM disk, please go for it. 1.6 Configuring NakedEye NakedEye will run fine in most situations with a decent hardware set-up. However, you can get the most out of NakedEye by doing some tuning to fit it in perfectly with your system. You can set the variables in NakedEye.cfg to alter the behaviour of NakedEye. svga is a variable to be set to the full path name to your preferred SuperVga BGI driver. Some video cards have their own BGI driver, therefore if the standard BGI driver which comes with NakedEye does not work, you should set this to the one that works. Here is an example svga=c:\mydriver.bgi You have to be careful if you choose a different BGIdriver for NakedEye. The mapping of the video mode numbers and the actual resolution in the Svga256.bgi driver is as follows: Mode 0 to 320x200 Mode 1 to 640x400 Mode 2 to 640x480 Mode 3 to 800x600 Mode 4 to 1024x768 If the mapping of your SuperVGA driver is different then some commands may switch NakedEye to a wrong resolution. bufpath is the directory path name to where the temporary buffer file for NakedEye to swap decoded raster images out when memory is low. It should be set to your fastest and/or largest hard disk. Here is an example bufpath=c:\tmp NakedEye uses the hard disk very often for swapping therefore it creates a number of temporary files that will be removed when no longer needed. However, your system crashes when NakedEye is running, these files may have to be removed manually if your are short of space. That is why it is a good idea to set bufpath to a directory which is used mainly for temporary stuffs that can be removed at any time. ems is a yes/no flag to indicate whether you want NakedEye to use EMS memory. The default is yes as this is what most people want. greeting is a yes/no flag to indicate that whether you want to have the LOGO display when NakedEye starts up. You may want to disable it when you have got a registered copy of the software and do not want to wait 30 seconds for the LOGO to disappear. compress is a yes/no flag that indicates whether you would like NakedEye to compress the color table. The default is yes because this is what almost everybody wants. quick start is a yes/no flag that indicates whether a quick start-up is what you want. This is identical to option /q on the command line. If it is set to yes, the LOGO and file selection menus are skipped altogether. But the only difference is that NakedEye will start up with the Full Screen mode OFF instead of ON NakedEye has been designed to be simple. This configuration step unfortunately makes it look a little bit complex. However, it is hoped that you will not have to do much configuration at all and still get what you want out of NakedEye. 1.7 Some conditions Personal use here is granted for an unregistered copy of NakedEye, however an unregistered copy is not fully activated, and you definitely miss out some of the exotic features. I will be very happy to give a registered copy of this software out to anyone who makes a reasonable donation to support an environmental organisation for instance GreenPeace. Simply send me a proof of such an effort and the money covering postage and diskettes. For others who wish to have a fully functional copy of NakedEye, please send a registration form to me. You will receive the latest copy of NakedEye. The alternative is to donate the money to an environmental organisation, then send me the money to cover for postage and diskettes. If you are on the Internet, I can e-mailed the key to you after receiving the registration form. I also disclaim any responsibility in case the software causes any damage to your computer. It has been tested fully and no bug is currently known, apart from some possible problems with the SuperVga graphics driver when an unpopular video card is used. I hope that everybody will enjoy NakedEye, please send all comments to my e-mail address v.mai@uow.edu.au or mail me at Mr. Van Dao MAI 50/7 Corrimal st. Wollongong N.S.W 2500 Australia Any suggestion for improvement would be greatly appreciated.