\n"; } print "$back_name " if ($back_en); print "最新" if ($nolist_order and $listfile_en == 0); print "
\n" if ($back_en or $nolist_order);
if ($comment_loc == 0) {
&comment_disp("$comment");
}
if ($shrink_en == 0){
print "
\n";
} else {
if (! -e "$thumbsdir"){
mkdir "$thumbsdir" or &error("$thumbsdirを作成できません。");
}
my $im;
$image =~ /\.jpe?g$/i and $im = GD::Image->newFromJpeg($imagefile);
$image =~ /\.gif$/i and $im = GD::Image->newFromGif($imagefile);
$image =~ /\.png$/i and $im = GD::Image->newFromPng($imagefile);
my ($width, $height) = $im->getBounds();
my $new_width;
my $new_height;
if ($width > $target_width or $height > $target_height){
my $width_shrink = $target_width / $width;
my $height_shrink = $target_height / $height;
my $shrink_ratio;
if ($width_shrink < $height_shrink){
$shrink_ratio = $width_shrink;
} else {
$shrink_ratio = $height_shrink;
}
$new_width = int($width * $shrink_ratio);
$new_height = int($height * $shrink_ratio);
} else {
$new_width = $width;
$new_height = $height;
}
my $thumbsbody = "${body}_${new_width}x${new_height}";
my $thumbimage = "$thumbsdir/$thumbsbody.$ext[$format]";
if (! -e "$thumbimage"){
&genimage($im,$new_width,$new_height,$width,$height,$thumbimage);
}
my $kbyte = -s "$thumbimage"; # get file size
if ($kbyte > $size_limit * 1024 and $size_limit_en){
my $size_ratio = sqrt(($size_limit*1024)/$kbyte);
my $new_width2 = int($new_width * $size_ratio);
my $new_height2 = int($new_height * $size_ratio);
$thumbsbody = "${body}_${new_width2}x${new_height2}";
$thumbimage = "$thumbsdir/$thumbsbody.$ext[$format]";
if (! -e "$thumbimage"){
&genimage($im,$new_width2,$new_height2,$width,$height,$thumbimage);
}
}
undef $im;
print "
\n";
}
if ($comment_loc == 1) {
&comment_disp("$comment
");
}
if ($previmage eq '') {
$prevlink="$back";
$prevtitle = "トップへ";
} else {
$prevlink = "$script?image=$previmage";
}
if ($nextimage eq '') {
$nextlink="$back";
$nexttitle = "トップへ";
} else {
$nextlink = "$script?image=$nextimage";
}
print qq{←$prevtitle\n};
print qq{$nexttitle→
\n};
if ($adminlink_en) {
print qq{管理用