Skip to content

Commit

Permalink
Merge pull request #275 from ex-hentai/patch-5
Browse files Browse the repository at this point in the history
resample uploaded images instead of resize
  • Loading branch information
xiaomlove authored Sep 13, 2024
2 parents 4d86538 + b6a566b commit 85136b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
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);
Expand Down
2 changes: 1 addition & 1 deletion public/bitbucket-upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
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);
Expand Down

0 comments on commit 85136b7

Please sign in to comment.