Guest
로그인
회원가입
val1['selected']">
val1['open_window']=='Y'">About
val2['selected']" >
val2['open_window']=='Y'">About
val2['selected']" >
val2['open_window']=='Y'">Team
val2['selected']" >
val2['open_window']=='Y'">Event
val2['selected']" >
val2['open_window']=='Y'">Brand
val1['selected']">
val1['open_window']=='Y'">Get Involved
val2['selected']" >
val2['open_window']=='Y'">Learn
val2['selected']" >
val2['open_window']=='Y'">개발자 가이드
val2['selected']" >
val2['open_window']=='Y'">API
val1['selected']">
val1['open_window']=='Y'">Blog
val1['selected']">
val1['open_window']=='Y'">Download
val2['selected']" >
val2['open_window']=='Y'">XE 자료실
val2['selected']" >
val2['open_window']=='Y'">마켓 허브
val1['selected']">
val1['open_window']=='Y'">Support
val2['selected']" >
val2['open_window']=='Y'">포럼
val2['selected']" >
val2['open_window']=='Y'">커뮤니티
val2['selected']" >
val2['open_window']=='Y'">묻고답하기
val2['selected']" >
val2['open_window']=='Y'">웹마스터 팁
val2['selected']" >
val2['open_window']=='Y'">사용자 가이드
val2['selected']" >
val2['open_window']=='Y'">웹사이트 개발 문의
val2['selected']" >
val2['open_window']=='Y'">XE1 제작 의뢰
val2['selected']" >
val2['open_window']=='Y'">XE1 제작 지원
val2['selected']" >
val2['open_window']=='Y'">구인/구직
val2['selected']" >
val2['open_window']=='Y'">호스팅 홍보
val2['selected']" >
val2['open_window']=='Y'">공식사이트 이용문의
val1['selected']">
val1['open_window']=='Y'">Showcase
val1['selected']">
val1['open_window']=='Y'">XE3
val2['selected']" >
val2['open_window']=='Y'">XE3
쓰기
웹마스터 팁
전체
외부이미지 링크 + 고해상도 이미지 섬네일 생성 팁
socialskyo
2015.05.26 10:25:50
0
https://github.com/xpressengine/xe-core/issues/790
위 글타래를 보고 글타래 안에 있는 @proglos 님 팁과 @bj람보님이 제안해준 방법을 조합시켜 사용중에 있습니다. 저는 이렇게 하니
아직까지 100%는 아니지만 섬네일 미싱 이슈가 가장 줄어들었습니다.
아직 https 로 된 외부이미지는 못가져오는 듯 합니다. 다음CDN/루리웹등과 같은 사이트의 이미지는 랜덤하게 미싱하는 경우가 있습니다.
document.item.php 에서 아래 부분을 Replace 해주세요.
// If not exists, file an image file from the content
if(!$source_file)
{
$content = $this->get('content');
$target_src = null;
preg_match_all('/<\s*img[^>]*src\s*=\s*["\']?([^"\']*)/i', $content, $matches, PREG_SET_ORDER);
$cnt = count($matches);
for($i=0;$i<$cnt;$i++)
{
$target_src = trim($matches[$i][1]);
if(preg_match('/\/(common|modules|widgets|addons|layouts)\//i', $target_src)) continue;
else
{
if(!preg_match('/^(http|https):\/\//i',$target_src)) $target_src = Context::getRequestUri().$target_src;
$tmp_file = sprintf('./files/cache/tmp/%d', md5(rand(111111,999999).$this->document_srl));
if(!is_dir('./files/cache/tmp')) FileHandler::makeDir('./files/cache/tmp');
FileHandler::getRemoteFile($target_src, $tmp_file);
if(!file_exists($tmp_file)) continue;
else
{
list($_w, $_h, $_t, $_a) = getimagesize($tmp_file);
// if($_w<$width || $_h<$height) continue;
$source_file = $tmp_file;
$is_tmp_file = true;
break;
}
}
}
}
이 게시물을
좋아요 0
태그목록
없음
첨부파일 목록
없음
목록으로 돌아가기
댓글 쓰기