mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
resample uploaded images instead of resize
(cherry picked from commit 7dcc41765313b1b097efa86d4a99fc8787b2c464)
This commit is contained in:
@@ -109,7 +109,7 @@ if ($Attach->enable_attachment())
|
|||||||
if ($orig && !$stop)
|
if ($orig && !$stop)
|
||||||
{
|
{
|
||||||
$thumb = imagecreatetruecolor($newwidth, $newheight);
|
$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'){
|
if ($thumbnailtype_attachment == 'createthumb'){
|
||||||
$hasthumb = true;
|
$hasthumb = true;
|
||||||
imagejpeg($thumb, $file_location.".".$ext.".thumb.jpg", $thumbquality_attachment);
|
imagejpeg($thumb, $file_location.".".$ext.".thumb.jpg", $thumbquality_attachment);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST")
|
|||||||
if(!$orig)
|
if(!$orig)
|
||||||
stderr($lang_bitbucketupload['std_image_processing_failed'],$lang_bitbucketupload['std_sorry_the_uploaded']."$imgtypes[$it]".$lang_bitbucketupload['std_failed_processing']);
|
stderr($lang_bitbucketupload['std_image_processing_failed'],$lang_bitbucketupload['std_sorry_the_uploaded']."$imgtypes[$it]".$lang_bitbucketupload['std_failed_processing']);
|
||||||
$thumb = imagecreatetruecolor($newwidth, $newheight);
|
$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) {
|
switch ($it) {
|
||||||
case 1:
|
case 1:
|
||||||
$ret = imagegif($thumb, $tgtfile);
|
$ret = imagegif($thumb, $tgtfile);
|
||||||
|
|||||||
Reference in New Issue
Block a user