Skip to content

Commit 7b16ee5

Browse files
committed
サムネイル作成処理の共通化。PHP8.5テスト通過。
1 parent 345d796 commit 7b16ee5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

logconverter/poti2/poti2petit.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@
121121
}
122122
//webpサムネイル
123123
if(!is_file("petit/webp/{$time}t.webp")){
124-
thumb("petit/src/",$imgfile,$time,300,800,['webp'=>true]);
124+
thumbnail_gd::thumb("petit/src/",$imgfile,$time,300,800,['webp'=>true]);
125125
}
126126
//webp s サムネイル
127-
if(thumb('petit/src/',$imgfile,$time,$w,$h,['thumbnail_webp'=>true])){
127+
if(thumbnail_gd::thumb('petit/src/',$imgfile,$time,$w,$h,['thumbnail_webp'=>true])){
128128
$thumbnail='thumbnail_webp';
129129
}
130130
if(!$thumbnail && is_file(THUMB_DIR."{$_time}s.jpg")){//画像
@@ -369,7 +369,7 @@ function switch_tool($tool){
369369
class thumbnail_gd {
370370

371371
public static function thumb($path,$fname,$time,$max_w,$max_h,$options=[]): ?string {
372-
$path=basename($path).'/';
372+
// $path=basename($path).'/';
373373
$fname=basename($fname);
374374
$time=basename($time);
375375
if(!ctype_digit($time)) {
@@ -587,17 +587,17 @@ private static function createThumbnailImage($im_out, $time, $options): ?string
587587

588588
} elseif(isset($options['webp'])){
589589

590-
$outfile='poti/webp/'.$time.'t.webp';
590+
$outfile='petit/webp/'.$time.'t.webp';
591591
ImageWEBP($im_out, $outfile,90);
592592

593593
}elseif(isset($options['thumbnail_webp'])){
594594

595-
$outfile=THUMB_DIR.$time.'s.webp';
595+
$outfile="petit/thumbnail/{$time}s.webp";
596596
ImageWEBP($im_out, $outfile,90);
597597

598598
}else{
599599

600-
$outfile=THUMB_DIR.$time.'s.jpg';
600+
$outfile="petit/thumbnail/{$time}s.jpg";
601601
// サムネイル画像を保存
602602
ImageJPEG($im_out, $outfile,90);
603603

0 commit comments

Comments
 (0)