home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
imahtmup.zip
/
imaghtml.txt
< prev
Wrap
Text File
|
2002-02-04
|
5KB
|
117 lines
IMAGHTML.CMD - a rexx program to build an HTML catalog of all the GIF,
PNG, and JPG files in a directory. The images are full size unless they
exceed a specified value in which case they are scaled (I originally
created this for buttons and the like that I've collected from a number
of free sites).
Prog level 2.x.9 1 Nov 2001
(refreshed 4 Feb 2001 - cleaned up syntax errors)
Usage is imaghtml [outfile [cols] [imagedir] ]
The output is to a file images.htm unless another file name is specified
as the first argument to the program.
It puts the images in the specified number of columns. The default is 5
but this can be changed by editing the file and changing the value for
the variable 'defcol'.
If an image directory is specified as the second or 3rd argument,
it is used as the source of the images; otherwise the current
directory is used.
IMAGHTML shows the filesize of each image file and the image size (in
pixels) of each file. I have coded directly the extraction of size info
for GIF PNG & JPG files; this code has not been widely tested on a lot
of files.
The output file <IMG SRC tags include ALT= HEIGHT= and WIDTH=
modifiers, to allow you to paste the information into a document you are
working on and follow good HTM style practices.
For example:
<IMG SRC="fixed.gif" ALT="fixed.gif" WIDTH=51 HEIGHT=12>
New in 2.x.10
Added parameter to make all filenames lowercase in the generated
html. This is useful when you have a case-sensitive web host (unix)
and an ftp client like ncftp that PUTs files and makes their remote
names all lowercase.
New in 2.x.9
Added parameter imgextra = any string that you might want to
add to the <img src="...> tag - such as an attribute like
align=left or whatever.
Now either .JPG or .JPEG is acceptable for a jpeg file.
Files are sorted alphabetically, rather than by extension as before.
Unfortunately, the sort is case sensitive.
New in 2.x.8
Added the border= attribute and a parameter for the default border
for an image - 0 (2 is the default if there's no border attribute
in the IMG tag). I wanted this for my own use, it was a nuisance to
have to manually add the border attribute to all the image links.
Also made some changes to improve readability of
the raw images.htm file, and added a timestamp to the output.
New in 2.x.7
Fixed minor bug if RXQUEUE wasn't empty.
New in 2.x.6
Added the target option for window control when a thumbnail is clicked.
New in 2.x.2 - 2.x.5
Reworked to allow it to be used against a directory on a CDROM,
either by specifying an output file on a different drive and
being in the CDROM directory, or specifying the image directory
as the second or 3rd argument. Also added the ability to click
on a thumbnail to view a reduced image full size, and fixed a bug
where some jpg files were not being correctly handled.
Also fixed it to work with filenames that include a space.
NEW in 2.x.1:
I added code to handle large images. If the image
width and height are both less than the parameters 'maxwidth' and
'maxheight' then the image is shown without scaling. If either
dimension exceeds the max, the image displayed is scaled so that
the dimension that most exceeds its maximum is reduced to that value,
with a proportional reduction in the other dimension. The approximate
scaling factor is shown. The HTML code includes a commented line
(delimited by <!-- and -->) with the true WIDTH and HEIGHT values
rather than the scaled values, which are what the browser will see.
The idea for this came from Craig <craigm@nsutah.com> who created
a PICVIEW.CMD file that he generously shared with me; this gave me
the idea of letting the browser make the thumbnails dynamically.
Clicking on a thumbnail will cause netscape to display the
image full size. The parameter 'target' controls whether this is
in the same window, a separate window (default), or a separate window for each
thumbnail clicked. The disadvantage of using only one window is that the
imaghtml file reloads when you use the 'BACK' button; if there are a lot of
images, this can be a slow process. Thanks to swordedg for this tip.
I've also added code to optionally call netscape to view the resulting
image file. To use this, you need to edit imaghtml.cmd and find the
lines (in the parameter block near the top):
netscape='NO'
netscapecall="d:\ns461\program\netscape.exe -browser -l en_US"
change the first to read netscape='Y' (or 'YES') and the second
to use the correct path to netscape.exe on your machine.
Hope it's useful. JT "Julian Thomas" <jt@jt-mj.net>