스크롤 최신글 제목 출력문의 드립니다. 채택완료
안녕하세요.
그누 최신글 스킨을 이용하는중 제목출력이 안되서 문의 드립니다.
아래 소스로된 스킨 이용중입니다.
어떻게 해야 제목을 뽑을 수 있을까요..?
다른 스킨과 비교해서 좀 해볼려구 했는데 영 답을 못찾겠네요..
function UnsharpMask($img, $amount, $radius, $threshold) { // Attempt to calibrate the parameters to Photoshop: if ($amount > 500) $amount = 500; $amount = $amount * 0.016; if ($radius > 50) $radius = 50; $radius = $radius * 2; if ($threshold > 255) $threshold = 255;
$radius = abs(round($radius)); // Only integers make sense. if ($radius == 0) { return $img; imagedestroy($img); break; } $w = imagesx($img); $h = imagesy($img); $imgCanvas = $img; $imgCanvas2 = $img; $imgBlur = imagecreatetruecolor($w, $h);
// Gaussian blur matrix: // 1 2 1 // 2 4 2 // 1 2 1
// Move copies of the image around one pixel at the time and merge them with weight // according to the matrix. The same matrix is simply repeated for higher radii. for ($i = 0; $i < $radius; $i++) { imagecopy ($imgBlur, $imgCanvas, 0, 0, 1, 1, $w - 1, $h - 1); // up left imagecopymerge ($imgBlur, $imgCanvas, 1, 1, 0, 0, $w, $h, 50); // down right imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 1, $w, $h - 1, 25); // up right imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 0, $w, $h, 25); // right imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 1, $w, $h - 1, 20 ); // up imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 16.666667); // down imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 0, $w, $h, 50); // center } $imgCanvas = $imgBlur; // Calculate the difference between the blurred pixels and the original // and set the pixels for ($x = 0; $x < $w; $x++) { // each row for ($y = 0; $y < $h; $y++) { // each pixel $rgbOrig = ImageColorAt($imgCanvas2, $x, $y); $rOrig = (($rgbOrig >> 16) & 0xFF); $gOrig = (($rgbOrig >> 8) & 0xFF); $bOrig = ($rgbOrig & 0xFF); $rgbBlur = ImageColorAt($imgCanvas, $x, $y); $rBlur = (($rgbBlur >> 16) & 0xFF); $gBlur = (($rgbBlur >> 8) & 0xFF); $bBlur = ($rgbBlur & 0xFF);
// When the masked pixels differ less from the original // than the threshold specifies, they are set to their original value. $rNew = (abs($rOrig - $rBlur) >= $threshold) ? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig)) : $rOrig; $gNew = (abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig; $bNew = (abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig; if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) { $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew); ImageSetPixel($img, $x, $y, $pixCol); } } } return $img; }
function brightness($image, $param=40) { $image_width = imagesx($image); $image_height = imagesy($image);
for ($h = 0; $h < $image_height; $h++) { for ($w = 0; $w < $image_width; $w++) { $colors = imagecolorsforindex($image, imagecolorat($image, $w, $h)); $colors['red'] = max(0, min(255, $colors['red'] + $param)); $colors['green'] = max(0, min(255, $colors['green'] + $param)); $colors['blue'] = max(0, min(255, $colors['blue'] + $param)); $new_color = imagecolorallocate($image, $colors['red'], $colors['green'], $colors['blue']); imagesetpixel($image, $w, $h, $new_color); } }
}
function contrast($image, $param=1.0) { $image_width = imagesx($image); $image_height = imagesy($image);
for ($h = 0; $h < $image_height; $h++) { for ($w = 0; $w < $image_width; $w++) { $colors = imagecolorsforindex($image, imagecolorat($image, $w, $h)); $colors['red'] = max(0, min(255, $colors['red'] * $param)); $colors['green'] = max(0, min(255, $colors['green'] * $param)); $colors['blue'] = max(0, min(255, $colors['blue'] * $param)); $new_color = imagecolorallocate($image, $colors['red'], $colors['green'], $colors['blue']); imagesetpixel($image, $w, $h, $new_color); } } }
?> //썸네일 코드 시작 $data_path = $g4['path'] . "/data/file/{$bo_table}";//라이브러리 파일 참조 $thumb_path = $data_path.'/latest'; if (!is_dir($thumb_path)) { @mkdir($thumb_path, 0707); @chmod($thumb_path, 0707); } $view_w = 148; //썸네일 가로사이즈 $view_h = 100; //썸네일 세로사이즈
for ($i=0; $i $dst = imagecreatetruecolor($view_w, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
$dst = brightness($dst, 50);
$dst = contrast($dst, 1.25);
$dst = UnsharpMask($dst, 80, 0.5, 3);
imagepng($dst, $thumb_path.'/'.$filename, $sch_q);
}
chmod($thumb_path.'/'.$filename, 0707);
} }
}
?>
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인