Skip to content

Commit

Permalink
PHP5.6対応を終了したため、PHP7.0以上の確認処理を削除。
Browse files Browse the repository at this point in the history
  • Loading branch information
satopian committed Nov 17, 2024
1 parent 8dcc002 commit f721553
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions potiboard5/thumbnail_gd.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// https://paintbbs.sakura.ne.jp/
// originalscript (C)SakaQ 2005 http://www.punyu.net/php/

$thumbnail_gd_ver=20241102;
$thumbnail_gd_ver=20241117;
defined('PERMISSION_FOR_DEST') or define('PERMISSION_FOR_DEST', 0606); //config.phpで未定義なら0606
class thumbnail_gd {

Expand All @@ -18,7 +18,7 @@ public static function thumb($path,$fname,$time,$max_w,$max_h,$options=[]){
if(!gd_check()||!function_exists("ImageCreate")||!function_exists("ImageCreateFromJPEG")){
return;
}
if((isset($options['webp'])||isset($options['thumbnail_webp'])) && (!function_exists("ImageWEBP") || version_compare(PHP_VERSION, '7.0.0', '<'))){
if((isset($options['webp'])||isset($options['thumbnail_webp'])) && !function_exists("ImageWEBP")){
return;
}

Expand Down Expand Up @@ -129,7 +129,7 @@ private static function createImageResource($fname,$mime_type) {
if(!$im_in)return;
break;
case "image/webp";
if(!function_exists("ImageCreateFromWEBP")||version_compare(PHP_VERSION, '7.0.0', '<')){//webp
if(!function_exists("ImageCreateFromWEBP")){//webp
return;
}
$im_in = @ImageCreateFromWEBP($fname);
Expand Down Expand Up @@ -164,7 +164,7 @@ private static function overwriteResizedImage($im_out, $fname, $mime_type) {
}
break;
case "image/webp";
if(function_exists("ImageWEBP")&&version_compare(PHP_VERSION, '7.0.0', '>=')){
if(function_exists("ImageWEBP")){
ImageWEBP($im_out, $outfile,98);
}else{
ImageJPEG($im_out, $outfile,98);
Expand All @@ -185,7 +185,7 @@ private static function createThumbnailImage($im_out, $time, $options) {

} elseif(isset($options['png2webp'])){

if(function_exists("ImageWEBP")&& version_compare(PHP_VERSION, '7.0.0', '>=')){
if(function_exists("ImageWEBP")){
$outfile=TEMP_DIR.$time.'.webp.tmp';//一時ファイル
ImageWEBP($im_out, $outfile,98);
}else{
Expand Down

0 comments on commit f721553

Please sign in to comment.