Casey's ImgInfo
---------------

This program reads the dimensions (width and height) from JPG or GIF image
files and reports them in a format suitable for use in web pages. This is a
quick way to create HTML image tags with the correct width and height
parameters required by web browsers for faster page rendering.

The default output format is HTML format image tags. These tags are
designed to be directly included in any HTML or XHTML file and file names
are cleaned for maximum compatibility.

File name cleaning rules:

 + Spaces in file names are changed to a plus (+) sign which represents
   the space character to web servers.

 + Ampersand (&) characters in the file name are changed to %26.

The screen output may be redirected to a file using a greater-than (>)
character followed by a file name.


Syntax:

 IMGINFO [<path>]<filemask> [<format_file>] [/D]

 filemask     = Any valid file name. Wildcards are allowed if multiple
                images are desired. Path or file names that contain spaces
                must be enclosed in double quotes.

 format_file  = This optionally allows a custom output format. The file may
                contain any of the following replacement parameters.

                {F} = Full filename (e.g., EXAMPLE.JPG)

                {FP} = Subdirectory at end of path plus the file name.
                      (e.g., IMAGES/EXAMPLE.JPG)

                {FR} = Root file name (e.g., EXAMPLE)

                {S} = File size in bytes (e.g., 1024)

                {SR} = Rounded file size (e.g., 1K)

                {W} = Image width in pixels (e.g., 800)

                {H} = Image height in pixels (e.g., 600)

                {C} = Number of bits color depth (e.g., 24)

                {P} = Subdirectory at end of path (e.g., IMAGES)
                      This allows tagging a file with the image
                      subdirectory. For example: C:\WEB\IMAGES
                      returns "IMAGES".

 /D           = Enable debug mode. This displays the internal processing
                and all of the extra image information gathered.


Example:

 IMGINFO "C:\My Pictures\*.JPG" > IMAGELIST.TXT

This scans the "C:\My Pictures" directory for all files with the ".JPG"
extension and creates HTML format image tags in the IMAGElIST.TXT file.


Example:

 IMGINFO "C:\WEB\IMAGES\*.GIF" FMT.TXT > IMAGES.TXT

This scans the "C:\WEB\IMAGES" directory for all files with the ".GIF"
extension and creates a text file called "IMAGES.TXT" using the format
pattern contained in the "FMT.TXT" file.

The commented PowerBASIC/CC source code is included. Feel free to fix bugs,
improve performance or add support for new image formats. Please send any
changes so they can be made available to everyone else.

Created 2009, updated 2010 by Casey Sprangel. The latest version of this
program and other utilities can be found on the WWW.IFXGROUP.NET web site.

