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

uwuzu v1.6.7 Hapuego

This commit is contained in:
だいちまる
2025-12-26 12:12:47 +09:00
parent 2b107acc17
commit 0666b6b2c4
23 changed files with 349 additions and 204 deletions
+6 -7
View File
@@ -566,8 +566,10 @@ function resizeImage($filePath, $maxWidth, $maxHeight) {
list($originalWidth, $originalHeight) = getimagesize($filePath);
if ($originalWidth <= $maxWidth && $originalHeight <= $maxHeight) {
imagewebp($originalImage, $filePath, 90);
imagedestroy($originalImage);
$originalImage_webp = imagecreatetruecolor($originalWidth, $originalHeight);
imagecopyresampled($originalImage_webp, $originalImage, 0, 0, 0, 0, $originalWidth, $originalHeight, $originalWidth, $originalHeight);
imagewebp($originalImage_webp, $filePath, 90);
return true;
}
@@ -588,11 +590,8 @@ function resizeImage($filePath, $maxWidth, $maxHeight) {
// 画像をリサイズ
imagecopyresampled($resizedImage, $originalImage, 0, 0, 0, 0, $newWidth, $newHeight, $originalWidth, $originalHeight);
// リサイズされた画像を表示
imagewebp($resizedImage, $filePath);
// メモリの解放
imagedestroy($originalImage);
imagedestroy($resizedImage);
imagewebp($resizedImage, $filePath, 90);
return true;
}
}