
HTMLサムネイル作成

＜概要＞
　カレントディレクトリ中のファイル（画像など）について、サムネイルのHTMLファイルを作成します。サブディレクトリや親ディレクトリにサムネイルファイルがあればリンクを作成します。
　サムネイルはテーブル上に配置します。列数はパラメータで指定し、サムネイルのサイズは列数に合わせて自動的に計算します。
　元々はCD-Rに保存した写真のサムネイルファイルを作成する目的だったので、元の大きい画像の表示サイズを指定することでブラウザに縮小させています。これをWebページでやると、大きい画像を読み込むためにサムネイル表示に時間がかかるので、オプションでサムネイル用の画像を生成できるようにしています。
　サブディレクトリに再帰的にサムネイルを作成できますので、コマンド１発でファイルを保存したディレクトリツリーにサムネイルを作成できます。

＜前提条件・制限＞
　JPEG、GIF、WAV、AVI、MPEGファイルについてサムネイルを作成します。WAV、AVI、MPEGファイルの縮小表示はありません。JPEG、GIFファイルと拡張子以外は同じWAVファイルが存在する場合、それらといっしょに表示します。
　OS/2でFATフォーマットでのLongnameの使用を前提としています。これは、CD-Rに8.3形式のファイル名で焼くファイルをFATのハードディスク上に一旦保存し、Longnameを付加してサムネイルファイルを作成するという使い方を想定しています。サムネイルのタイトルはLongname、画像のリンク先はFATのファイル名を使用します。
　文字列置換関数を使用しています。オプションとして、サムネイル用の画像を生成する場合は、Imagemagickのconvertユーテリィティを使用します。

＜インストール＞

    ソースをパスの通ったディレクトリにデータファイルとしてコピーします。 

＜パラメータ＞
mkthumb[.cmd] 再帰的(Y/N) ファイル名/日時切替(N/D) サムネイルイメージ作成(Y/N) 1行に入るサムネイルの数 サムネイルファイル上書き(Y/N) サムネイルファイル名
　全てデフォルトで実行も可能です。
mkthumb help 　ヘルプを表示します。

    再帰的:Y/N（デフォルトN）：サブディレクトリやその下のサブディレクトリにも再帰的にサムネイルを作成するかどうかを指定します。
    ファイル名/日時切替:N/D（デフォルトN）：サムネイルの下にファイル名を表示するかファイルの更新日時を表示するかを切替えます。
    サムネイルイメージ作成:Y/N（デフォルトN）：サムネイル表示専用のファイルを生成するかどうかを指定します。
    1行に入るサムネイルの数:n（デフォルト5）：1行に入れるサムネイル画像の数を指定します。
    サムネイルファイル上書き:Y/N（デフォルトN）：サムネイルファイルが存在する場合に上書きするかどうかを指定します。
    サムネイルファイル名（デフォルトthumb.htm）：サムネイルファイル名です。 

＜実行＞
　OS/2コマンドプロンプトで、サムネイルを作成したいディレクトリに移動して実行してください。

例：
[E:\WALLP]mkthumb n n
Thumbnail file for WALLP generated.

[E:\WALLP]

＜ソース＞
　HTMLの元ネタはREXXのソースに埋め込んでいます。ソースの最後の部分で、"$$templ$"で始まる行を区切りとして、HTMLの各部分を一部書換えながら出力しています。
　ヘルプもREXXのソース中のコメントを表示するようにしてみました。"パラメータ"という文字列を含む行の次の行から"*/"を含む行の手前まで出力します。
　Muleのhtml-helper-mode用に、"<!-- hhmts start -->"や"<!-- hhmts end -->"という文字列をサムネイルファイルに埋め込んでいます。ファイルを後からMuleで編集する際に、html-helper-modeが更新日時を埋め込んでくれます。


ENGLISH TRANSLATION WITH GOOGLE
--------------------------------

Translation types
Text translation
Source text

HTML samuneiru sakusei < gaiyō > karentodirekutori-chū no fairu (gazō nado) ni tsuite, samuneiru no eichitīemuerufairu o sakusei shimasu. Sabu direkutori ya oya direkutori ni samuneiru fairu ga areba rinku o sakusei shimasu. Samuneiru wa tēburu-jō ni haichi shimasu. Retsu-sū wa paramēta de shitei shi, samuneiru no saizu wa retsu-sū ni awa sete jidōteki ni keisan shimasu. Motomoto wa CD - R ni hozon shita shashin no samuneiru fairu o sakusei suru mokutekidattanode,-moto no ōkī gazō no hyōji saizu o shitei suru koto de burauza ni shukushō sa sete imasu. Kore o u~ebu pēji de yaru to, ōkī gazō o yomikomu tame ni samuneiru hyōji ni jikan ga kakarunode, opushon de samuneiru-yō no gazō o seisei dekiru yō ni shite imasu. Sabu direkutori ni saiki-teki ni samuneiru o sakusei dekimasunode, komando 1-patsu de fairu o hozon shita direkutoritsurī ni samuneiru o sakusei dekimasu. < Zentei jōken seigen > jeipegu, GIF, WAV, avu~i, MPEG fairu ni tsuite samuneiru o sakusei shimasu. WAV, avu~i, MPEG fairu no shukushō hyōji wa arimasen. Jeipegu, GIF fairu to kakuchōshi igai wa onaji WAV fairu ga sonzai suru baai, sorera to issho ni hyōji shimasu. OS/ 2 de fatto fōmatto de no Longname no shiyō o zentei to shite imasu. Kore wa, CD - R ni 8. 3 Keishiki no fairu-mei de yaku fairu o fatto no hādodisuku-jō ni ittan hozon shi, Longname o fuka shite samuneiru fairu o sakusei suru to iu tsukaikata o sōtei shite imasu. Samuneiru no taitoru wa Longname, gazō no rinku-saki wa fatto no fairu-mei o shiyō shimasu. Mojiretsu chikan kansū o shiyō shite imasu. Opushon to shite, samuneiru-yō no gazō o seisei suru baai wa, Imagemagick no konbāto yūteryiti o shiyō shimasu. < Insutōru > sōsu o pasu no tōtta direkutori ni dētafairu to shite kopī shimasu. < Paramēta > mkthumb [. Cmd] saiki-teki (Y / N) fairu-mei/ nichiji kirikae (N / D) samuneiruimēji sakusei (Y / N) 1-gyō ni hairu samuneiru no sū samuneiru fairu uwagaki (Y / N) samuneiru fairu-mei subete deforuto de jikkō mo kanōdesu. Mkthumb herupu herupu o hyōji shimasu. Saiki-teki: Y/ N (deforuto N): Sabu direkutori ya sono-ka no sabudirekutori ni mo saiki-teki ni samuneiru o sakusei suru ka dō ka o shitei shimasu. Fairu-mei/ nichiji kirikae: N/ D (deforuto N): Samuneiru no shita ni fairu-mei o hyōji suru ka fairu no kōshin nichiji o hyōji suru ka o kirikaemasu. Samuneiruimēji sakusei: Y/ N (deforuto N): Samuneiru hyōji sen'yō no fairu o seisei suru ka dō ka o shitei shimasu. 1-Gyō ni hairu samuneiru no kazu: N (deforuto 5): 1-Gyō ni ireru samuneiru gazō no kazu o shitei shimasu. Samuneiru fairu uwagaki: Y/ N (deforuto N): Samuneiru fairu ga sonzai suru baai ni uwagaki suru ka dō ka o shitei shimasu. Samuneiru fairu-mei (deforuto thumb. Htm): Samuneiru fairu-meidesu. < Jikkō > OS/ 2 komandopuronputo de, samuneiru o sakusei shitai direkutori ni idō shite jikkō shite kudasai. Rei: [E : \ WALLP] mkthumb n n Thumbnail fairu fō WALLP generated. [E : \ WALLP] < sōsu > HTML no moto neta wa REXX no sōsu ni umekonde imasu. Sōsu no saigo no bubun de,"$$ templ $" de hajimaru gyō o kugiri to shite, HTML no kaku bubun o ichibu kakikaenagara shutsuryoku shite imasu. Herupu mo REXX no sōsu-chū no komento o hyōji suru yō ni shite mimashita." Paramēta" to iu mojiretsu o fukumu gyō no tsugi no gyō kara"*/" o fukumu gyō no temae made shutsuryoku shimasu. Mūru no html - helper - mōdo-yō ni,"<!-- Hhmts start -->" ya"<!-- Hhmts end -->" to iu mojiretsu o samuneirufairu ni umekonde imasu. Fairuwo-go kara mūru de henshū suru sai ni, html - helper - mōdo ga kōshin nichiji o umekonde kuremasu.
Show more
1,773 / 5,000
Translation results
HTML thumbnail creation

<Overview>
Creates a thumbnail HTML file for the files (images, etc.) in the current directory. Create a link if there is a thumbnail file in a subdirectory or parent directory.
"Thumbnails will be placed on the table." The number of columns is specified by a parameter, and the thumbnail size is automatically calculated according to the number of columns.
Originally, the purpose was to create a thumbnail file of the photos saved on the CD-R, so by specifying the display size of the original large image, the browser reduced it. If you do this on a web page, it takes a long time to display thumbnails due to loading large images, so you can optionally generate images for thumbnails.
You can recursively create thumbnails in subdirectories, so you can create thumbnails in the directory tree where files are saved with a single command.

<Prerequisites and Restrictions>
Create thumbnails for JPEG, GIF, WAV, AVI, and MPEG files. No thumbnails for WAV, AVI, MPEG files. If there are JPEG, GIF files and WAV files that are the same except for the extension, they will be displayed together.
It assumes the use of Longname in FAT format on OS/2. This assumes that the files to be burned to CD-R with 8.3 format file names are temporarily saved on a FAT hard disk, and then longnames are added to create thumbnail files. Use Longname for thumbnail titles and FAT file names for image links.
　The string replacement function is used. Optionally, use Imagemagick's convert utility to generate images for thumbnails.

<Installation>

    Copy the source to a directory in your path as a data file.

<Parameter>
mkthumb[.cmd] Recursive (Y/N) File name/date/time switching (N/D) Thumbnail image creation (Y/N) Number of thumbnails per line Overwrite thumbnail file (Y/N) Thumbnail file name
"All can be executed by default."
mkthumb help Display help.

    Recursive: Y/N (default N): Specify whether to recursively create thumbnails in subdirectories and subdirectories below.
    File name/date/time switch: N/D (default N): Switches whether to display the file name or the file update date/time under the thumbnail.
    Thumbnail image creation: Y/N (default N): Specify whether to generate a file dedicated to thumbnail display.
    Number of thumbnails per line: n (default 5): Specify the number of thumbnail images per line.
    Overwrite thumbnail files: Y/N (default N): Specify whether to overwrite thumbnail files if they exist.
    Thumbnail filename (default thumb.htm): The thumbnail filename.

<Execute>
　From the OS/2 command prompt, move to the directory where you want to create thumbnails and execute.

example:
[E:\WALLP] mkthumb n n
Thumbnail file for WALLP generated.

[E:\WALLP]

<Source>
The source material for the HTML is embedded in the REXX source. At the end of the source, the line starting with "$$templ$" is used as a delimiter, and each part of HTML is partially rewritten and output.
I tried to display the comments in the REXX source for the help as well. Outputs from the line following the line containing the string "parameter" to the line containing "*/".
For Mule's html-helper-mode, the strings "<!-- hhmts start -->" and "<!-- hhmts end -->" are embedded in the thumbnail file. html-helper-mode embeds the modified date and time when you edit the file later with Mule.
More about this source text
Source text required for additional translation information
Send feedback
Side panels


LINK
https://web.archive.org/web/20050123231419/http://www2u.biglobe.ne.jp/~gwm01021/rexx7-2.htm