Skip to content

Commit

Permalink
thumbnail GD ファイルが存在していなかったらreturn
Browse files Browse the repository at this point in the history
  • Loading branch information
satopian committed Mar 22, 2022
1 parent d85990b commit 0a72a22
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion potiboard5/thumbnail_gd.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
defined('PERMISSION_FOR_DEST') or define('PERMISSION_FOR_DEST', 0606); //config.phpで未定義なら0606

function thumb($path,$tim,$ext,$max_w,$max_h){
$fname=$path.$tim.$ext;
if(!is_file($fname)){
return;
}
if(!gd_check()||!function_exists("ImageCreate")||!function_exists("ImageCreateFromJPEG")){
return;
}
$fname=$path.$tim.$ext;

$size = GetImageSize($fname); // 画像の幅と高さとタイプを取得
// リサイズ
$w_h_size_over=($size[0] > $max_w || $size[1] > $max_h);
Expand Down

0 comments on commit 0a72a22

Please sign in to comment.