home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / imahtmup.zip / imaghtml.txt < prev   
Text File  |  2002-02-04  |  5KB  |  117 lines

  1. IMAGHTML.CMD - a rexx program to build an HTML catalog of all the GIF,
  2. PNG, and JPG files in a directory.  The images are full size unless they
  3. exceed a specified value in which case they are scaled (I originally
  4. created this for buttons and the like that I've collected from a number
  5. of free sites).
  6.  
  7. Prog level 2.x.9  1 Nov 2001
  8. (refreshed 4 Feb 2001 - cleaned up syntax errors)
  9.  
  10. Usage is imaghtml [outfile [cols] [imagedir] ]
  11.  
  12. The output is to a file images.htm unless another file name is specified
  13. as the first argument to the program.
  14.  
  15. It puts the images in the specified number of columns.  The default is 5
  16. but this can be changed by editing the file and changing the value for
  17. the variable 'defcol'.
  18.  
  19. If an image directory is specified as the second or 3rd argument,
  20. it is used as the source of the images; otherwise the current
  21. directory is used.
  22.  
  23. IMAGHTML shows the filesize of each image file and the image size (in
  24. pixels) of each file.  I have coded directly the extraction of size info
  25. for GIF PNG & JPG files; this code has not been widely tested on a lot
  26. of files.
  27.  
  28. The output file <IMG SRC tags include ALT= HEIGHT= and WIDTH=
  29. modifiers, to allow you to paste the information into a document you are
  30. working on and follow good HTM style practices.
  31.  
  32. For example:
  33.  
  34. <IMG SRC="fixed.gif" ALT="fixed.gif" WIDTH=51 HEIGHT=12>
  35.  
  36. New in 2.x.10
  37.  
  38. Added parameter to make all filenames lowercase in the generated
  39. html.  This is useful when you have a case-sensitive web host (unix)
  40. and an ftp client like ncftp that PUTs files and makes their remote
  41. names all lowercase.
  42.  
  43. New in 2.x.9
  44.  
  45. Added parameter imgextra = any string that you might want to
  46. add to the <img src="...> tag - such as an attribute like
  47. align=left or whatever.
  48.  
  49. Now either .JPG or .JPEG is acceptable for a jpeg file.
  50.  
  51. Files are sorted alphabetically, rather than by extension as before.
  52. Unfortunately, the sort is case sensitive.
  53.  
  54. New in 2.x.8
  55.  
  56. Added the border= attribute and a parameter for the default border
  57. for an image  - 0 (2 is the default if there's no border attribute
  58. in the IMG tag).  I wanted this for my own use, it was a nuisance to
  59. have to manually add the border attribute to all the image links.
  60.  
  61. Also made some changes to improve readability of
  62. the raw images.htm file, and added a timestamp to the output.
  63.  
  64. New in 2.x.7
  65.  
  66. Fixed minor bug if RXQUEUE wasn't empty.
  67.  
  68. New in 2.x.6
  69.  
  70. Added the target option for window control when a thumbnail is clicked.
  71.  
  72. New in 2.x.2 - 2.x.5
  73.  
  74. Reworked to allow it to be used against a directory on a CDROM,
  75. either by specifying an output file on a different drive and
  76. being in the CDROM directory, or specifying the image directory
  77. as the second or 3rd argument.  Also added the ability to click
  78. on a thumbnail to view a reduced image full size, and fixed a bug
  79. where some jpg files were not being correctly handled.
  80. Also fixed it to work with filenames that include a space.
  81.  
  82.  
  83. NEW in 2.x.1:
  84. I added code to handle large images.  If the image
  85. width and height are both less than the parameters 'maxwidth' and
  86. 'maxheight' then the image is shown without scaling.  If either
  87. dimension exceeds the max, the image displayed is scaled so that
  88. the dimension that most exceeds its maximum is reduced to that value,
  89. with a proportional reduction in the other dimension.  The approximate
  90. scaling factor is shown.  The HTML code includes a commented line
  91. (delimited by <!--  and -->) with the true WIDTH and HEIGHT values
  92. rather than the scaled values, which are what the browser will see.
  93.  
  94. The idea for this came from Craig <craigm@nsutah.com> who created
  95. a PICVIEW.CMD file that he generously shared with me; this gave me
  96. the idea of letting the browser make the thumbnails dynamically.
  97.  
  98. Clicking on a thumbnail will cause netscape to display the
  99. image full size. The parameter 'target' controls whether this is
  100. in the same window, a separate window (default), or a separate window for each
  101. thumbnail clicked.  The disadvantage of using only one window is that the
  102. imaghtml file reloads when you use the 'BACK' button; if there are a lot of
  103. images, this can be a slow process.  Thanks to swordedg for this tip.
  104.  
  105.  
  106. I've also added code to optionally call netscape to view the resulting
  107. image file.  To use this, you need to edit imaghtml.cmd and find the
  108. lines (in the parameter block near the top):
  109.  
  110. netscape='NO'
  111. netscapecall="d:\ns461\program\netscape.exe -browser -l en_US"
  112.  
  113. change the first to read netscape='Y'  (or 'YES') and the second
  114. to use the correct path to netscape.exe on your machine.
  115.  
  116. Hope it's useful.  JT "Julian Thomas" <jt@jt-mj.net>
  117.