私は他の非常に多くのスレッドを調べましたが、png画像が透明になるはずの場所で黒くなるという問題があり、どの解決策もうまくいきませんでした。
たぶん、コードのどこかで間違っているのでしょうか? 私のウェブサーバーでは imagealhpablending がサポートされていないのでしょうか?
助けてくれる人に感謝します。
$photo = imagecreatefrompng( "{$thumb_folder}{$new_file_name}" );
$width = imagesx($photo);
$height = imagesy($photo);
$new_width = 32;
$new_height = floor($height / ($width / $new_width));
$temp_photo = imagecreatetruecolor($new_width, $new_height);
imagealphablending($temp_photo, false);
imagesavealpha($temp_photo, true);
$transparent = imagecolorallocatealpha($temp_photo, 255, 255, 255, 127);
imagefilledrectangle($temp_photo, 0, 0, $new_width, $new_height, $transparent);
imagecopyresampled($temp_photo, $photo, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagepng($temp_photo, "{$thumb_folder}{$new_file_name}" );