From b6a566bdd55d89218b11f562ab9856a7e199a54f Mon Sep 17 00:00:00 2001 From: NekoCH <96158157+ex-hentai@users.noreply.github.com> Date: Tue, 23 May 2023 15:56:28 +0800 Subject: [PATCH] resample uploaded images instead of resize (cherry picked from commit 7dcc41765313b1b097efa86d4a99fc8787b2c464) --- public/attachment.php | 2 +- public/bitbucket-upload.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/attachment.php b/public/attachment.php index c70d3d04..a2290dfb 100644 --- a/public/attachment.php +++ b/public/attachment.php @@ -109,7 +109,7 @@ if ($Attach->enable_attachment()) if ($orig && !$stop) { $thumb = imagecreatetruecolor($newwidth, $newheight); - imagecopyresized($thumb, $orig, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); + imagecopyresampled($thumb, $orig, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); if ($thumbnailtype_attachment == 'createthumb'){ $hasthumb = true; imagejpeg($thumb, $file_location.".".$ext.".thumb.jpg", $thumbquality_attachment); diff --git a/public/bitbucket-upload.php b/public/bitbucket-upload.php index bcbfb7b7..da598450 100644 --- a/public/bitbucket-upload.php +++ b/public/bitbucket-upload.php @@ -48,7 +48,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") if(!$orig) stderr($lang_bitbucketupload['std_image_processing_failed'],$lang_bitbucketupload['std_sorry_the_uploaded']."$imgtypes[$it]".$lang_bitbucketupload['std_failed_processing']); $thumb = imagecreatetruecolor($newwidth, $newheight); - imagecopyresized($thumb, $orig, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); + imagecopyresampled($thumb, $orig, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); switch ($it) { case 1: $ret = imagegif($thumb, $tgtfile);