Merge branch 'g5'

This commit is contained in:
chicpro committed 2014-09-25 17:02:28 +09:00
commit dfd7e6d5ee
2 files changed
+17 -2

No files matched your search

+1 -1
View File
@@ -192,7 +192,7 @@ function order_select($fld, $sel='')
if (!$member['mb_id']) if (!$member['mb_id'])
{ {
//alert('로그인 하십시오.', '$g5['bbs_path']/login.php?url=' . urlencode('$_SERVER['PHP_SELF']?w=$w&mb_id=$mb_id')); //alert('로그인 하십시오.', '$g5['bbs_path']/login.php?url=' . urlencode('$_SERVER['PHP_SELF']?w=$w&mb_id=$mb_id'));
alert('로그인 하십시오.', G5_BBS_URL.'/login.php?url=' . urlencode($_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'])); alert('로그인 하십시오.', G5_BBS_URL.'/login.php?url=' . urlencode(G5_ADMIN_URL));
} }
else if ($is_admin != 'super') else if ($is_admin != 'super')
{ {
+16 -1
View File
@@ -235,6 +235,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
if ($size[2] == 1) { if ($size[2] == 1) {
$src = imagecreatefromgif($source_file); $src = imagecreatefromgif($source_file);
$src_transparency = imagecolortransparent($src);
} else if ($size[2] == 2) { } else if ($size[2] == 2) {
$src = imagecreatefromjpeg($source_file); $src = imagecreatefromjpeg($source_file);
@@ -332,9 +333,15 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
if($size[2] == 3) { if($size[2] == 3) {
imagealphablending($dst, false); imagealphablending($dst, false);
imagesavealpha($dst, true); imagesavealpha($dst, true);
} else if($size[2] == 1 && $src_transparency != -1) {
$transparent_color = imagecolorsforindex($src, $src_transparency);
$current_transparent = imagecolorallocate($dst, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);
imagefill($dst, 0, 0, $current_transparent);
imagecolortransparent($dst, $current_transparent);
} }
} else { } else {
$dst = imagecreatetruecolor($dst_w, $dst_h); $dst = imagecreatetruecolor($dst_w, $dst_h);
$bgcolor = imagecolorallocate($dst, 255, 255, 255); // 배경색
if($src_w < $dst_w) { if($src_w < $dst_w) {
if($src_h >= $dst_h) { if($src_h >= $dst_h) {
@@ -359,8 +366,16 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
imagefill($dst, 0, 0, $bgcolor); imagefill($dst, 0, 0, $bgcolor);
imagealphablending($dst, false); imagealphablending($dst, false);
imagesavealpha($dst, true); imagesavealpha($dst, true);
} else if($size[2] == 1) {
if($src_transparency != -1) {
$transparent_color = imagecolorsforindex($src, $src_transparency);
$current_transparent = imagecolorallocate($dst, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);
imagefill($dst, 0, 0, $current_transparent);
imagecolortransparent($dst, $current_transparent);
} else {
imagefill($dst, 0, 0, $bgcolor);
}
} else { } else {
$bgcolor = imagecolorallocate($dst, 255, 255, 255); // 배경색
imagefill($dst, 0, 0, $bgcolor); imagefill($dst, 0, 0, $bgcolor);
} }
} }