mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
fix #1079 프로필 이미지에 gif 이미지 사용 시, 의도와 다르게 resize하는 문제 고침
This commit is contained in:
parent
ea37270bd0
commit
3f8da3eae9
1 changed files with 16 additions and 5 deletions
|
|
@ -716,18 +716,29 @@ class memberController extends member
|
||||||
// Get a target path to save
|
// Get a target path to save
|
||||||
$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
|
$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
|
||||||
FileHandler::makeDir($target_path);
|
FileHandler::makeDir($target_path);
|
||||||
|
|
||||||
// Get file information
|
// Get file information
|
||||||
list($width, $height, $type, $attrs) = @getimagesize($target_file);
|
list($width, $height, $type, $attrs) = @getimagesize($target_file);
|
||||||
if($type == 3) $ext = 'png';
|
if(IMG_PNG == $type) $ext = 'png';
|
||||||
elseif($type == 2) $ext = 'jpg';
|
elseif(IMG_JPG == $type) $ext = 'jpg';
|
||||||
else $ext = 'gif';
|
elseif(IMG_GIF == $type) $ext = 'gif';
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
FileHandler::removeFilesInDir($target_path);
|
FileHandler::removeFilesInDir($target_path);
|
||||||
|
|
||||||
$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
|
$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
|
||||||
// Convert if the image size is larger than a given size or if the format is not a gif
|
// Convert if the image size is larger than a given size or if the format is not a gif
|
||||||
if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
|
if(($width > $max_width || $height > $max_height ) && $type != 1)
|
||||||
else @copy($target_file, $target_filename);
|
{
|
||||||
|
FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@copy($target_file, $target_filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue