수정전
if (file_exists($dest_path))
{
$size = getimagesize($dest_path);
// 이미지의 폭 또는 높이가 설정값 보다 크다면 이미 업로드 된 이미지 삭제
if ($size[0] > $config[cf_member_photo_width] || $size[1] > $config[cf_member_photo_height])
@unlink($dest_path);
}
수정후
if (file_exists($dest_path))
{
$size = getimagesize($dest_path);
// 이미지의 폭 또는 높이가 설정값 보다 크다면 이미 업로드 된 이미지 리사이즈
if ($size[0] > $config[cf_member_photo_width] || $size[1] > $config[cf_member_photo_height]) {
$width = $config[cf_member_photo_width];
$height = $config[cf_member_photo_height];
$cfile = imagecreatefromjpeg($dest_path);
$dest = imagecreatetruecolor($width, $height);
imagecopyresampled($dest, $cfile, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
imagejpeg($dest, $dest_path, 90); }
}
====================================================================
댓글 4개
if (file_exists($dest_path))
{
$size = getimagesize($dest_path);
// 이미지의 폭 또는 높이가 설정값 보다 크다면 이미 업로드 된 이미지 삭제
if ($size[0] > $config[cf_member_photo_width] || $size[1] > $config[cf_member_photo_height])
@unlink($dest_path);
}
수정후
if (file_exists($dest_path))
{
$size = getimagesize($dest_path);
// 이미지의 폭 또는 높이가 설정값 보다 크다면 이미 업로드 된 이미지 리사이즈
if ($size[0] > $config[cf_member_photo_width] || $size[1] > $config[cf_member_photo_height]) {
$width = $config[cf_member_photo_width];
$height = $config[cf_member_photo_height];
$cfile = imagecreatefromjpeg($dest_path);
$dest = imagecreatetruecolor($width, $height);
imagecopyresampled($dest, $cfile, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
imagejpeg($dest, $dest_path, 90); }
}
====================================================================
ㅇ이거요... 이걸 적용해봣는데 에러가 나요 ㅠㅠ .
수정 전
$width = $config['cf_member_icon_width'];
$height = $config['cf_member_icon_height'];
$tmp_name = "<img src='$icon_file' width='$width' height='$height' align='absmiddle' border='0'>";
수정 후
//$width = $config['cf_member_icon_width'];
//$height = $config['cf_member_icon_height'];
$tmp_name = "<img src='$icon_file' align='absmiddle' border='0'>";
참고한 내용
- 회원사진 추가하기 2 (http://www.morssola.com/bbs/tb.php/1021_g4web/20)
그리고 저위에 유디님 팁적용하고 그걸 적용해야 되나요 ?
아님 그것만?