1
0
mirror of https://github.com/Daichimarukana/uwuzu.git synced 2026-06-04 19:14:41 +00:00

uwuzu v1.6.11 Hapuego

This commit is contained in:
だいちまる
2026-01-05 12:28:17 +09:00
parent 8a276490b8
commit d3a40d0285
4 changed files with 15 additions and 9 deletions
+5 -1
View File
@@ -589,8 +589,10 @@ function resizeImage($filePath, $maxWidth, $maxHeight) {
if ($originalWidth <= $maxWidth && $originalHeight <= $maxHeight) {
$originalImage_webp = imagecreatetruecolor($originalWidth, $originalHeight);
imagecopyresampled($originalImage_webp, $originalImage, 0, 0, 0, 0, $originalWidth, $originalHeight, $originalWidth, $originalHeight);
imagealphablending($originalImage_webp, false);
imagesavealpha($originalImage_webp, true);
imagecopyresampled($originalImage_webp, $originalImage, 0, 0, 0, 0, $originalWidth, $originalHeight, $originalWidth, $originalHeight);
imagewebp($originalImage_webp, $filePath, 90);
return true;
}
@@ -609,6 +611,8 @@ function resizeImage($filePath, $maxWidth, $maxHeight) {
// 新しい画像リソースを作成
$resizedImage = imagecreatetruecolor($newWidth, $newHeight);
imagealphablending($resizedImage, false);
imagesavealpha($resizedImage, true);
// 画像をリサイズ
imagecopyresampled($resizedImage, $originalImage, 0, 0, 0, 0, $newWidth, $newHeight, $originalWidth, $originalHeight);
// リサイズされた画像を表示