Mkphotohtml Ver.1.1
山田邦博です。
Mkphotohtml のバージョンアップです。
(1) 出力ファイル photo.html を Another HTML-lint でチェックして、文
法違反と警告が出ないようにした。
(2) テーマオプションを 3 個追加。
以上を diff ファイルとして添付します。(README と 本体の mkphotohtml の
み)
-...-
Mkphotohtml Ver.1.1 の全てのファイルは
ftp://ftp.tksa.gr.jp/king/image/Mkphotohtml_1.1.tgz
にあります。
インストール スクリプトもそこに入っています。
最新の Mkphotohtml (ドキュメントを含む)については
http://www.tksa.gr.jp/king/Software/Mkphotohtml/index.html
を参照して下さい。
そこに実例も示しておきました。
-...-
Version 1 は 1.1 が最終となります。(patch 版を除く)
既に Version 2 に取り掛かったため。
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
--- Mkphotohtml_1.0/doc/README.jp.txt 2003-07-29 16:34:35.000000000 +0900
+++ Mkphotohtml_1.1/doc/README.jp.txt 2003-09-12 22:55:48.000000000 +0900
@@ -5,7 +5,7 @@
山田邦博
YAMADA Kunihiro <king@tksa.gr.jp>
- 29 Jul.2003 (Release 1.0)
+ 12 Sep.2003 (Release 1.1)
Copyright policy: GNU GPL Ver.2
@@ -93,6 +93,7 @@
メッセージファイル中に "Back:" 項が指定してある時、この -b オプ
ションがあると、photo.html に 戻りボタン が付く。
デフォールトは 戻りボタン が付かない。
+ このオプションは "-o Back=Yes" と同一である。
-c : Clean bogus shrinked images.
指定されたディレクトリ(デフォールトはカーレントディレクトリ)の
テーマ内の縮小された画像の内、対応する生画像がない場合、その祝
@@ -178,6 +179,9 @@
User-Name=...
Scale-Directory=...
Size-of-Picture=...
+ Back=...
+ Start=...
+ Top=...
Theme:
Theme=テーマ名 # default: ディレクトリ名
@@ -480,6 +484,34 @@
うか、-f オプション(Force update) 付きで mkphotohtml を
起動する必要がある。
+ Back=有無
+ Back : (Bak)
+ photo.html に 戻りボタン を付けるかどうかを指定する。
+
+ 有無 : No (Non,Not) ... Default
+ 戻りボタン が付かない。
+ Yes (Use)
+ メッセージファイル中に "Back:" 項の指定があれ
+ ば、戻りボタンが付く。
+
+ Start=有無
+ Start : (Sta)
+ photo.html の header 部内に <link rel="start" ...> を
+ 付加するかどうか指定する。
+
+ 有無 : Yes (Use) ... Default
+ 付加する。
+ No (Non,Not)
+ 付加しない。
+
+ Top=url
+ Top : (省略形はない)
+ Start オプションで付加する時の address または URL を指
+ 定する。
+
+ url : Web page 内の address または URL。
+ デフォールト値は "/index.html" である。
+
メッセージファイル:
------------------
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2003-09-21 23:27 JST by <king@owlin>.
# Source directory was `/home/king/tmp'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 16317 -rw-r----- mkphotohtml_1.1.diff
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
if test "$gettext_dir" = FAILED && test -f $dir/gettext \
&& ($dir/gettext --version >/dev/null 2>&1)
then
set `$dir/gettext --version 2>&1`
if test "$3" = GNU
then
gettext_dir=$dir
fi
fi
if test "$locale_dir" = FAILED && test -f $dir/shar \
&& ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
then
locale_dir=`$dir/shar --print-text-domain-dir`
fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
echo=echo
else
TEXTDOMAINDIR=$locale_dir
export TEXTDOMAINDIR
TEXTDOMAIN=sharutils
export TEXTDOMAIN
echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
shar_touch='touch -am $3$4$5$6$2 "$8"'
else
shar_touch=:
echo
$echo 'WARNING: not restoring timestamps. Consider getting and'
$echo "installing GNU \`touch', distributed in GNU File Utilities..."
echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh01867; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
exit 1
fi
# ============= mkphotohtml_1.1.diff ==============
if test -f 'mkphotohtml_1.1.diff' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'mkphotohtml_1.1.diff' '(file already exists)'
else
$echo 'x -' extracting 'mkphotohtml_1.1.diff' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'mkphotohtml_1.1.diff' &&
--- Mkphotohtml_1.0/bin/mkphotohtml 2003-07-29 23:26:54.000000000 +0900
+++ Mkphotohtml_1.1/bin/mkphotohtml 2003-09-12 23:06:39.000000000 +0900
@@ -48,6 +48,7 @@
X # INSTALL.jp.txt
X # MUMBLE.jp.txt
X # README.jp.txt (Japanese text only, sorry)
+# TODO.jp.txt
X #
X
X # Latest version:
@@ -64,6 +65,8 @@
X # 21 Jun.2003 rewrite almost
X # 22 Jul.2003 Ver.1.0-pre.1 : Released
X # 29 Jul.2003 Ver.1.0 : Released
+# 2 Aug.2003 Ver.1.0-patch.01 : Released
+# 12 Sep.2003 Ver.1.1 : Released
X #
X
X no lib qw(:ALL .);
@@ -74,8 +77,10 @@
X use Time::localtime;
X use File::stat;
X use IPC::Open2;
+use Net::Domain qw(hostfqdn hostdomain);
+use Image::Size 'html_imgsize';
X use vars qw($opt_b $opt_c $opt_D $opt_e $opt_f $opt_h $opt_m
- $opt_n $opt_o $opt_r $opt_u $opt_v);
+ $opt_n $opt_o $opt_r $opt_s $opt_t $opt_u $opt_v);
X
X die "$0 : \"Root user or group\" is prohibitted, sorry.\n"
X if $< == 0 or $> == 0 or $( == 0 or $) == 0; # uid,euid,gid,egid : root?
@@ -100,7 +105,6 @@
X # convert JFIF file to portable pixmap
X my $PNMSCALE = "/usr/bin/pnmscale"; # scale a PNM image
X my $PNMTOJPEG = "/usr/bin/pnmtojpeg"; # convert PNM image to a JFIF image
-my $HOSTNAME = "/bin/hostname"; # show or set the system's host name
X
X ## default for option -o ##
X ## These options can be changed by option -o or system and user option file,
@@ -122,6 +126,9 @@
X # Scale and Directory name for raw and shrinked pictures
X $::opt_size = "(Normal=1/2)(Header=1/4)(Index=1/8)";
X # Size of Picture for Normal, Header and Indicies display
+$::opt_back = "No"; # or Yes ( Back button added to photo.html)
+$::opt_start = "Yes"; # or No (start page added in HTML header)
+$::opt_top = "/index.html"; # link to Top page or URL
X
X ## Messages for HTML with multi lingual.
X ## These messages can be changed by option -o MessageFile=filepath.
@@ -153,7 +160,7 @@
X
X
X ### Constants ###
-my $VERSION = "1.0";
+my $VERSION = "1.1";
X my $WEBINFO = "http://www.tksa.gr.jp/king/Software/Mkphothtml/";
X
X my $PFIRST = "[-_]?(First|1st|Fir)";
@@ -172,10 +179,9 @@
X my @sorted_scale; # Sorted scale of Pictures
X my %version_checked;
X
-my ($BUTTON,$CLEAN,$DEBUG,$FORCEUPDATE,$HELP,$RECURSIVE,$VERBOSE);
+my ($CLEAN,$DEBUG,$FORCEUPDATE,$HELP,$RECURSIVE,$VERBOSE);
X
-getopts('bcDefhm:no:ru:v');
-$BUTTON = $opt_b;
+getopts('bcDefhm:no:rst:u:v');
X $CLEAN = $opt_c;
X $DEBUG = $opt_D;
X $FORCEUPDATE = $opt_f;
@@ -225,7 +231,8 @@
X Usage: $PNAME [option] [directories ...]
X
X Options:
- -b : Back button added to photo.html (Default: Not added)
+ -b : Back button added to photo.html
+ (same as -o "Back=Yes")
X -c : Clean up bogus shrinked images
X -D : Debug
X -e : English (same as -o Language=English)
@@ -256,7 +263,15 @@
X Size-of-Picture=(display1=scale1)(display2=scale2)....
X (Size of Picture for Normal, Header and Indices display)
X Default : $::opt_size
+ Back=No|Yes (Default : No)
+ Start=Yes|No (Default : Yes)
+ Top=url (Default : /index.html)
X -r : Recursive
+ -s : Suppress start page infomation in HTML header
+ (Same as -o "Start=No")
+ -t url :
+ address or URL of Top page for start
+ (same as -o "Top=url")
X -u username :
X Full name of user like as "Firstname Lastname"
X (same as -o "User-Name=Firstname Lastname")
@@ -311,6 +326,7 @@
X }
X }
X
+$::opt_back = "Yes" if $opt_b; # Back button
X $::opt_lang = "English" if $opt_e;
X $::opt_mail = $opt_m if $opt_m; # Mail address
X if ($opt_m) {
@@ -319,6 +335,8 @@
X EOF
X }
X $::opt_usenkf = "Use" if $opt_n;
+$::opt_start = "No" if $opt_s; # Start page info. into HTML header
+$::opt_top = $opt_t if $opt_t; # address or URL of Top page
X $::opt_uname = $opt_u if $opt_u; # User Name
X if ($opt_o) { # Option -o (from sh command)
X foreach (split m/,/,$opt_o) {
@@ -387,7 +405,7 @@
X sub set_option_from_file ( $;$ ) {
X my $file = shift;
X my $only_scale_size = shift;
- print "#",__LINE__,"# set_option_from_file, (",cwd,")($file) ",($only_scale_size?"ONLY":"ALL"),"\n" if $DEBUG;
+# print "#",__LINE__,"# set_option_from_file, (",cwd,")($file) ",($only_scale_size?"ONLY":"ALL"),"\n" if $DEBUG;
X open(INF,"<$file") || die "Cannot open file $file : $!";
X my $from = "conf";
X $from = "db" if $file =~ /$CONTENT$/;
@@ -621,6 +639,30 @@
X EOF
X } elsif (s/User?([-_]?Name?)?=\s*//i) {
X $::opt_uname = $_; # Name of User
+ } elsif (s/Back?=\s*//i) {
+ if (/^Yes$|^Use$/i) {
+ $::opt_back = "Yes";
+ } elsif (/^No[nt]?$/i) {
+ $::opt_back = "No";
+ } else {
+ die <<EOF;
+$errmes
+\t"Option: Back=" should be "Yes" or "No" ("Use" or "Non" can be used).
+EOF
+ }
+ } elsif (s/Sta(rt)?=\s*//i) {
+ if (/^Yes$|^Use$/i) {
+ $::opt_start = "Yes";
+ } elsif (/^No[nt]?$/i) {
+ $::opt_start = "No";
+ } else {
+ die <<EOF;
+$errmes
+\t"Option: Start=" should be "Yes" or "No" ("Use" or "Non" can be used).
+EOF
+ }
+ } elsif (s/Top=\s*//i) {
+ $::opt_top = $_;
X } elsif (/^$/) {
X # skip
X } else {
@@ -820,7 +862,9 @@
X $version = check_version($file,$_);
X }
X } elsif (/^Theme:/) {
+ print "#",__LINE__,"# getTheme (Theme:)\n" if $DEBUG;
X while($_ = get_config(*CF)) {
+# print "#",__LINE__,"# getTheme \$_=($_)\n" if $DEBUG;
X if (/^\s+Theme=(.*)/) {
X $theme = $1;
X } elsif (/^\s+Image=(.*)/) {
@@ -864,6 +908,34 @@
X return ($theme,$image,$comment,$mtime);
X } # end of getTheme
X
+sub get_theme_image ( $ ) {
+ my $theme_dir = shift;
+ print "#",__LINE__,"# get_theme_image: them_dir=($theme_dir)\n" if $DEBUG;
+ my $dbf = "$theme_dir$CONTENT";
+ die "!!BUG!! \"$dbf\" : not found : " unless -r $dbf;
+ my $save_ILN = $ILN;
+ my $imagef = "";
+ open(INGTI,$dbf) || die "Cannot read $dbf : $!";
+ OUTER:
+ while ($_ = get_config(*INGTI,$::opt_lang,$::opt_usenkf)) {
+ if (/^$PTHEME:$/io) {
+ while ($_ = get_config(*INGTI,$::opt_lang,$::opt_usenkf)) {
+ last OUTER if /^\S|^$/;
+ if (s/^\s+$PIMAGE=\s*//i) {
+ $imagef = "$theme_dir$_";
+ last OUTER;
+ }
+ }
+ }
+ }
+ die <<EOF unless $imagef;
+No theme image file found on "$dbf".
+EOF
+ close INGTI;
+ $ILN = $save_ILN;
+ return $imagef;
+}
+
X sub get_shrink_size () {
X # print "#",__LINE__,"# get_shrink_size\n" if $DEBUG;
X local $_ = $::opt_scale;
@@ -939,7 +1011,7 @@
X } # end of get_shrink_size
X
X sub get_only_shrink_size_from_file () {
- print "#",__LINE__,"# get_only_shrink_size_from_file\n" if $DEBUG;
+# print "#",__LINE__,"# get_only_shrink_size_from_file\n" if $DEBUG;
X local %::option_scale = %::option_scale;
X local %::option_size = %::option_size;
X my $only_scale_and_size = 1;
@@ -960,7 +1032,7 @@
X my ($header,$image) = @_;
X # print "#",__LINE__,"# image_path header='$header' image='$image'\n" if $DEBUG;
X unless ($image =~ /(.*)\.($IMGEXT)$/) {
- die "Bad image file name : ";
+ die "Bad image file name ($image) : ";
X }
X my ($base,$ext) = ($1,$2);
X my $path = "./"; # for mozilla
@@ -1181,6 +1253,9 @@
X local $::opt_messagefile = $::opt_messagefile;
X local $::opt_scale = $::opt_scale;
X local $::opt_size = $::opt_size;
+ local $::opt_back = $::opt_back;
+ local $::opt_start = $::opt_start;
+ local $::opt_top = $::opt_top;
X local %::html_charset = %::html_charset;
X local %::html_album = %::html_album;
X local %::html_comment = %::html_comment;
@@ -1225,6 +1300,48 @@
X $theTheme_theme = $_;
X } elsif (s/^\s+$PIMAGE=\s*//i) {
X $theTheme_image = $_;
+ if (m!/$!) {
+ print "#",__LINE__,"# Theme image : ($_)\n" if $DEBUG;
+ die <<EOF unless -d $_;
+Bad theme directory specified ($theTheme_image):
+\tat $pwd/$CONFIG line $ILN.
+EOF
+ if (-r "$theTheme_image$CONTENT") {
+ $theTheme_image
+ = get_theme_image($theTheme_image);
+ die <<EOF unless $theTheme_image;
+"$theTheme_image" : Bad theme specified.
+\tat $pwd/$CONFIG line $ILN.
+EOF
+ } else {
+ die <<EOF;
+"$theTheme_image/$CONTENT" : not found.
+\tat $pwd/$CONFIG line $ILN.
+EOF
+ }
+ }
+ unless ($theTheme_image =~ /(.*)\.($IMGEXT)$/) {
+ warn <<EOF;
+Bad theme image file name ($theTheme_image):
+\tat $pwd/$CONFIG line $ILN.
+\t..... ignored.
+EOF
+ $theTheme_image = "";
+ }
+ if ($theTheme_image) {
+ my $imp = (image_path("Header",$theTheme_image));
+ print "#",__LINE__,"# imp=($imp)\n" if $DEBUG;
+ unless ($imp and -r $imp) {
+ warn <<EOF;
+"$imp" is not found.
+\t\t.... ignored it and took default theme image instead.
+\t"$theTheme_image" is specified
+\t\tat $pwd/$CONFIG line $ILN.
+EOF
+ $theTheme_image = "";
+ }
+ }
+ print "#",__LINE__,"# theTheme_image:($theTheme_image)\n" if $DEBUG;
X } elsif (s/^\s+Com(ment)?=\s*//i) {
X s/^\s+//;
X $theTheme_comment = $_;
@@ -1260,12 +1377,15 @@
X $theme = $_;
X } elsif (s/^\s+$PIMAGE=\s*//i) {
X $image = $_;
- my $im = "theme_dir/$image";
+ my $im = "$theme_dir/$image";
X $im =~ s!/(.+)$!/$picrawdir/$1!;
X unless (-r $im) {
X $image = "";
- warn "Theme image($im) is not found in $pwd/$CONFIG",
- " ... ignored.\n";
+ warn <<EOF;
+Theme image($im) is not found
+\tat $pwd/$CONFIG line $ILN.
+\t ... ignored it and took default theme image instead.
+EOF
X }
X } elsif (s/^\s+Com(ment)?=\s*//i) {
X s/^\s+//;
@@ -1329,6 +1449,8 @@
X }
X my $mtime = get_mtime_of_original_file($image_file);
X if (defined $mtime) {
+ $name = $image_file unless $name;
+ $date = ctime($mtime) unless $date;
X push @contents,{ "ImageFile" => $image_file,
X "Name" => $name,
X "Date" => $date,
@@ -1473,6 +1595,9 @@
X \tUser-Name=$::opt_uname
X \tScale-Directory=$::opt_scale
X \tSize-of-Picture=$::opt_size
+\tBack=$::opt_back
+\tStart=$::opt_start
+\tTop=$::opt_top
X
X Theme:
X \tTheme=$theTheme_theme
@@ -1508,12 +1633,55 @@
X
X ### Generate photo.html ###
X my $back;
- $back = 1 if $BUTTON and $::html_back{$::opt_lang}
+ $back = 1 if $::opt_back eq "Yes" and $::html_back{$::opt_lang}
X and ($depth >= 2 or -r "../$HTML");
- my $html = undef;
+
+ $_ = $::opt_mail;
+ if (/\$userid\b|\${userid}/i) {
+ s/\$userid\b|\${userid}/$ENV{USER}/ig;
+ }
+ if (/\$fqdn\b|\${fqdn}/i) {
+ my $m = $_; # save $_ for Net::Domain ver. 2.13
+ my $f = hostfqdn();
+ $_ = $m; # restore $_
+ s/\$fqdn\b|\${fqdn}/$f/ig;
+ }
+ if (/\$domain\b|\${domain}/i) {
+ my $m = $_; # save $_ for Net::Domain ver. 2.13
+ my $d = hostdomain();
+ $_ = $m; # restore $_
+ s/\$domain\b|\${domain}/$d/ig;
+ }
+ $_ = "" if /^\$non$/;
+ my $mail_address = $_;
+
+ $_ = $::opt_uname;
+ if (/^\$passwd$/i) {
+ open(INP,"/etc/passwd") || die "Cannot read /etc/passwd : $!";
+ while (<INP>) {
+ next unless /^$ENV{USER}:/o;
+ /.*?:.*?:.*?:.*?:(.*)?:/;
+ $_ = $1;
+ s/,.*//s; # Full name of the user
+ last;
+ }
+ close(INP);
+ die "User name of \"$ENV{USER}\" is not found in /etc/passwd.\n"
+ unless $_;
+ }
+ if ($::opt_usenkf eq "Use" and $::opt_lang eq "Japanese") {
+ $_ = change_to_jis($_); # change code to 7bit jis
+ chomp;
+ print "#",__LINE__,"# User-Name with nkf, \$_=\"$_\"\n" if $DEBUG;
+ }
+ $_ = "" if /^\$non$/;
+ my $user_name = $_;
+
+ my $html = "";
X print "#",__LINE__,"# Generate $HTML\n" if $DEBUG;
X print "#",__LINE__,"# \$theTheme_image=`$theTheme_image'\n" if $DEBUG;
X my $titleimage = image_path("Header",$theTheme_image);
+ my $size_titleimage = html_imgsize($titleimage);
X $html = <<EOF;
X <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
X <!-- This is generated by $PNAME (version $VERSION).
@@ -1523,14 +1691,26 @@
X -->
X <html>
X <head>
+ <META HTTP-EQUIV="Content-Type"
+ CONTENT="text/html; charset=$::html_charset{$::opt_lang}">
+EOF
+ $html .= <<EOF if $::opt_start eq "Yes";
+ <link rel="start" href="$::opt_top">
+EOF
+ $html .= <<EOF if -r "../$HTML";
+ <link rel="previous" href="../$HTML">
+EOF
+ $html .= <<EOF if $mail_address;
+ <link rev="made" href="mailto:$mail_address">
+EOF
+ $html .= <<EOF;
X <title>$theTheme_theme</title>
X </head>
- <META HTTP-EQUIV="Content-Type"
- CONTENT="text/html; charset=$::html_charset{$::opt_lang}">
X <body>
X <center>
X <h1>$theTheme_theme</h1>
X <img src="$titleimage"
+ $size_titleimage
X alt="Theme-image: $theTheme_theme"><br>
X $theTheme_comment
X </center>
@@ -1547,10 +1727,12 @@
X if (exists $c->{ThemeDir}) { # SubThemeDir
X my $subtheme_image = image_path("Index","$c->{ThemeDir}/$c->{Image}");
X my $date = ctime($c->{Mtime});
- print "#",__LINE__,"# \$subtheme_image=$subtheme_image\n" if $DEBUG;
+ my $size_image = html_imgsize($subtheme_image);
+# print "#",__LINE__,"# \$subtheme_image=$subtheme_image\n" if $DEBUG;
X $html .= <<EOF;
X <a href="$c->{ThemeDir}/$HTML">
X <img src="$subtheme_image"
+ $size_image
X alt="CLICK HERE" align="left"></a>
X <font size="+2">$::html_theme{$::opt_lang}$c->{Theme}</font><br>
X <font size="-1">$::html_latest{$::opt_lang} $date</font><br>
@@ -1559,18 +1741,21 @@
X } elsif (exists $c->{ImageFile}) { # Image file
X $c->{ImageFile} =~ /(.*)(\.[^.]+)/;
X my ($base,$ext) = ($1,$2);
- my $imagefiles = "<a href=\""
- . image_path("Raw",$c->{ImageFile})
- . "\">$sorted_scale[0]</a>";
+ my $ifile = image_path("Raw",$c->{ImageFile});
+ my $imagefiles = "<a href=\"$ifile\" "
+ . "title=\"$c->{ImageFile}\">$sorted_scale[0]</a>";
X for my $scale (@sorted_scale[1..$#sorted_scale]) {
X my $ifile = image_path($scale,$c->{ImageFile});
- $imagefiles .= "\n\t, <a href=\"$ifile\">$scale</a>";
+ $imagefiles .= "\n\t, <a href=\"$ifile\" "
+ . "title=\"$c->{ImageFile}\">$scale</a>";
X }
X my $image_normal = image_path("Normal",$c->{ImageFile});
X my $image_index = image_path("Index", $c->{ImageFile});
+ my $size_index = html_imgsize($image_index);
X $html .= <<EOF;
X <a href="$image_normal">
X <img src="$image_index"
+ $size_index
X alt="CLICK HERE" align="left"></a>
X <font size="-1">
X $::html_arrow{$::opt_lang} $imagefiles
@@ -1585,41 +1770,6 @@
X }
X
X my $time = ctime();
- $_ = $::opt_mail;
- if (/\$userid\b|\${userid}/i) {
- s/\$userid\b|\${userid}/$ENV{USER}/ig;
- }
- if (/\$fqdn\b|\${fqdn}/i) {
- my $f = qx($HOSTNAME -f);
- chomp $f;
- s/\$fqdn\b|\${fqdn}/$f/ig;
- }
- if (/\$domain\b|\${domain}/i) {
- my $d = qx($HOSTNAME -d);
- chomp $d;
- s/\$domain\b|\${domain}/$d/ig;
- }
-
- my $mail_address = $_;
- $_ = $::opt_uname;
- if (/^\$passwd$/i) {
- open(INP,"/etc/passwd") || die "Cannot read /etc/passwd : $!";
- while (<INP>) {
- next unless /^$ENV{USER}:/o;
- /.*?:.*?:.*?:.*?:(.*)?:/;
- $_ = $1;
- s/,.*//s; # Full name of the user
- last;
- }
- close(INP);
- die "User name of \"$ENV{USER}\" is not found in /etc/passwd.\n"
- unless $_;
- }
- if ($::opt_usenkf eq "Use" and $::opt_lang eq "Japanese") {
- $_ = change_to_jis($_); # change code to 7bit jis
- chomp;
- print "#",__LINE__,"# User-Name with nkf, \$_=\"$_\"\n" if $DEBUG;
- }
X
X $html .= <<EOF;
X <hr>
@@ -1627,10 +1777,10 @@
X $html .= <<EOF if $back;
X <a href="../$HTML">$::html_back{$::opt_lang}</a>
X EOF
- unless (/^\$non?$/i or $mail_address =~ /^\$non?$/i) {
+ if ($user_name and $mail_address) {
X $html .= <<EOF;
- <address><a href="mailto:<$mail_address>">
- $_</a></address>
+ <address><a href="mailto:$mail_address">
+ $user_name</a></address>
X EOF
X }
X $html .= <<EOF;
SHAR_EOF
(set 20 03 09 21 23 24 38 'mkphotohtml_1.1.diff'; eval "$shar_touch") &&
chmod 0640 'mkphotohtml_1.1.diff' ||
$echo 'restore of' 'mkphotohtml_1.1.diff' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'mkphotohtml_1.1.diff:' 'MD5 check failed'
0326ff3b02fa08c584b4c677e583e385 mkphotohtml_1.1.diff
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'mkphotohtml_1.1.diff'`"
test 16317 -eq "$shar_count" ||
$echo 'mkphotohtml_1.1.diff:' 'original size' '16317,' 'current size' "$shar_count!"
fi
fi
rm -fr _sh01867
exit 0
Fnews-brouse 1.9(20180406) -- by Mizuno, MWE <mwe@ccsf.jp>
GnuPG Key ID = ECC8A735
GnuPG Key fingerprint = 9BE6 B9E9 55A5 A499 CD51 946E 9BDC 7870 ECC8 A735