Skip to content

Commit

Permalink
PHP7.0以上の時にのみimagewebp()を使う。関数が存在していても画像が正しく処理されない。
Browse files Browse the repository at this point in the history
  • Loading branch information
satopian committed Mar 27, 2023
1 parent b48251b commit 608f114
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion petitnote/thumbnail_gd.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function thumb($path,$fname,$time,$max_w,$max_h,$options=[]){
}
break;
case "image/webp";
if(function_exists("ImageWEBP")){
if(function_exists("ImageWEBP")&&version_compare(PHP_VERSION, '7.0.0', '>=')){
ImageWEBP($im_out, $outfile,98);
}else{
ImageJPEG($im_out, $outfile,98);
Expand Down

0 comments on commit 608f114

Please sign in to comment.