묻고답하기

EXIF 0.5 애드온을 설치했더니..
이미지 삽입시에 이미지에 이어서 EXIF 정보가 출력 되는바람에.. 이미지가 왼쪽 정렬되고..
EXIF 정보도.. 이어서 보기 싫게 나오는 현상인데..

이 EXIF정보가 출력될때.. 먼저 선행으로 한칸 줄바꿈을 해준후에 뿌려진다면.
이문제가 해결되는군요..

우선 임시로.. span 앞에 <br> 을 넣었더니.. 깔끔하게 출력이 되는데.. 디스플레이 핸들러 워닝이 10개정도 뜨는군요
워닝없이 줄바꿔서 출력되도록 수정할려면 어떻게 해야 할까요?

ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅁ 아래는 원문입니다. ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
if(!defined("__ZBXE__")) exit();

if($called_position != "before_display_content") return;

// board & blog module에서만 동작하도록
$oBoardView = &getView('board');
$oBlogView = &getView('blog');

if(Context::getResponseMethod() == "XMLRPC"
 || Context::getRequestMethod() == 'XMLRPC'
 || ($oBoardView->act != 'dispBoardContent' && $oBlogView->act != 'dispBlogContent')) return;

if($oBoardView->act == 'dispBoardContent' || $oBlogView->act == 'dispBlogContent') {

 if($addon_info->mid_list) {
  $mid_list = explode(',', $addon_info->mid_list);
  if(!in_array(Context::get('mid'), array_map('trim', $mid_list))) return;
 }

 /**
  * @brief 이미지의 EXIF 정보를 반환
  * @param string $image 이미지파일 경로
  * @return mixed 이미지 EXIF 정보
  */
 function getExifData($matche_img)
 {
  // 파일명에 공백문자가 있을시 오류 때문에...
  $image_path = urldecode($matche_img[3]);

  // 파일이 존재하지 않으면 return
  if(!file_exists($image_path)) return;

  $file_ext = array_pop(explode('.', $image_path));
  if(strtolower($file_ext) != 'jpg') return $matche_img[0];

  // 캐싱을 위해 파일의 정보 가져오기
  $file_md5 = md5_file($image_path);
  $file_size = filesize($image_path);

  // cache 디렉토리 경로
  $cache_path = './files/cache/addon_image_exif/';
  $cache_file = sprintf('%s_%s.cache.php', $file_size, $file_md5);

  unset($cache_exif_data);
  $cache_exif_data = &getExifCache($cache_path, $cache_file);

  if($cache_exif_data) {
   $exif_data = &$cache_exif_data;
  } else {
   require_once $addon_path.'phpexifrw/exifReader.php';

   $er = new phpExifReader($image_path);
   $exif_data = &$er->getImageInfo();
  }

  if(!$cache_exif_data) setExifCache($cache_path, $cache_file, $exif_data);
  $return_exif = &returnExifInfo($exif_data);

  return $matche_img[0].$return_exif;
 }


 function getExifCache($cache_path, $cache_file) {
  if(!file_exists($cache_path.$cache_file)) return false;
  require_once $cache_path.$cache_file;
  return $exif_data;
 }

 function setExifCache($cache_path, $cache_file, &$exif_data) {
  if(!$exif_data['make']) return false;
  unset($exif_data['Thumbnail']);
  $cache = '<?php if(!defined("__ZBXE__")) exit();'."\r\n";
  foreach($exif_data as $key => $val) {
   $cache .= "\$exif_data['".$key."'] = \"".$val."\";\r\n";
  }
  $cache .= '?>';
  if(!is_dir($cache_path)) FileHandler::makeDir($cache_path);
  FileHandler::writeFile($cache_path.$cache_file, $cache);
 }

 function returnExifInfo(&$exif_data) {
  $exif_info = array();
  $separator = ' | ';
  if($exif_data['ExposureBiasValue']) {
   $evtmp = split(' ', $exif_data['ExposureBiasValue']);
   $exif_data['ExposureBiasValue'] = ((round($evtmp[0], 2) > 0)? '+': '').round($evtmp[0], 2).$evtmp[1];
  }
  if(!is_null($exif_data['whiteBalance'])) {
   $exif_data['whiteBalance'] = ($exif_data['whiteBalance']==0)?'Auto W/B':'Manual W/B';
  }
  if($exif_data['FNumber']) {
   $fntmp = split(' ', $exif_data['FNumber']);
   $exif_data['FNumber'] = $fntmp[0].round($fntmp[1], 2);
  }
  if($exif_data['make'])                     array_push($exif_info, $exif_data['make']);
  if($exif_data['model'])                    array_push($exif_info, $exif_data['model']);
  if($exif_data['exposure'])        array_push($exif_info, $exif_data['exposure']);
  if($exif_data['meteringMode'])           array_push($exif_info, $exif_data['meteringMode']);
  if($exif_data['whiteBalance'])           array_push($exif_info, $exif_data['whiteBalance']);
  if($exif_data['exposureTime'])           array_push($exif_info, $exif_data['exposureTime']).'sec';
  if($exif_data['fnumber'])                array_push($exif_info, strtoupper($exif_data['fnumber']));
  if($exif_data['maxaperturevalue'])       array_push($exif_info, strtoupper(str_replace(' ', '', $exif_data['maxaperturevalue'])));
  if($exif_data['exposureBias'])      array_push($exif_info, $exif_data['exposureBias']);
  if($exif_data['focalLength'])            array_push($exif_info, str_replace(' ', '', $exif_data['focalLength']));
  if($exif_data['flength35mm'])  array_push($exif_info, '35mm equiv '.$exif_data['flength35mm'].'mm');
  if($exif_data['isoEquiv'])        array_push($exif_info, 'ISO-'.$exif_data['isoEquiv']);
  if($exif_data['flashUsed'])                  array_push($exif_info, 'Flash-'.$exif_data['flashUsed']);
  if($exif_data['dateTimeDigitized'])      array_push($exif_info, $exif_data['dateTimeDigitized']);

  $return_exif = ($exif_info)?'<br><span style="BNU_EXIF_BOX_STYLE">'.implode($separator, $exif_info).'</span>':NULL;
  return $return_exif;               //붉은색부분이 제가 임의로 테스트상 삽입해 본 부분입니다.
 }

 // 추출된 이미지 경로로 getImageExif() 호출
 $pattern_image_tag = "/<img(.*?)(src=\"[^\040]*)(files\/attach\/images\/[^\"]+)+([^>]*?)(>)+/i";
 $pattern_documents_area = '/<!--BeforeDocument\([0-9]+,[0-9]+\)-->.+<!--AfterDocument\([0-9]+,[0-9]+\)-->/is';
 $output = preg_replace_callback($pattern_documents_area,
  create_function('$matches', "return preg_replace_callback('$pattern_image_tag', 'getExifData', \$matches[0]);"),
  $output);

 $output = str_replace('BNU_EXIF_BOX_STYLE', $addon_info->box_style, $output);
}

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
초보 스크롤 레이어가 작동이 제대로 안되네요?  
상큼상큼레몬 게시글 주소 안나오게 하는 방법이요~~ [1] file 2008.07.27 by 상큼상큼레몬
젠이 글 수정시 U 모양의 수정 아이콘 안 나오게 하는건 어케 하나요? [4] 2008.07.25 by 젠이
토니박스 2차메뉴 배열이 흐트러집니다. file  
스포츠좋아 작업 중이던 설정 값이 사라지고 초기화 되었어요....  
withhong 제로보드4에 있었던 전체쪽지보기 기능... [2] 2008.07.25 by withhong
자유로이 방문자는 없는데 조회수 카운트만 올라갑니다 [4] file 2008.07.25 by 뽀칠이
연해 게시판 등록일을 오늘이 아닌 임의의 날로 하는법 [1] 2008.07.25 by 양동화
인류학자 gallery 게시판에 목록에 그림이 뜨지 않네요. file  
박영권846 홈페이지에 제로보드을 설치을 했는데요! ㅠㅠ [1] 2008.07.25 by 대암지기
초봉이 본문에 사진 출력이 안됩니다.. 도와 주세요 [2] 2008.07.25 by 초봉이
김선생™ 제로보드XE 로 홈피만드어 쓰고있는데요. 방문카운터보다 게시물조회수가 훨많아서.  
정낙훈(xynex) 일면으로 보내기 기능 [2] 2008.07.25 by 정낙훈(xynex)
조러쉬 php.ini 파일 수정 문의 [1] 2008.07.25 by 제로보드 삽질맨
지오426 제로보드4에 있었던 기능인데 회원 게시물/댓글 추적은 안되나요? [1] 2008.07.25 by 라르게덴
XE사랑 XE 위젯에 뉴스티커가 원래부터 없나요... [3] 2008.07.25 by 질문한이
튀긴건빵 팝업위젯 안띄우는 시간수정하려면...  
helpme455 file내 attach/image 밑에 폴더가 많아요 용량이 급겹히 늘어나네요 [1] file 2008.07.25 by 띵야
행복한일상 1.05를 업데이트하고 하루정도 지났시점에서 갑자기 접속이 안됩니다. [1] 2008.07.25 by 띵야
강영길 라이센스 동의 후 경고 메세지.. [1] 2008.07.25 by 띵야
김형섭01 메인페이지가 않떠요 [1] 2008.07.25 by 띵야
사린자 윈도우 설치시 다시 되돌아가는 문제입니다. [4] 2008.07.25 by 사린자
특수용역 파일 첨부 시 100%에서 사라지네요. [4] 2008.07.25 by 제로보드 삽질맨
푸른솔아 누가 좀 도와 주세요.(답변없어 재질문) [2] 2008.07.25 by 푸른솔아
미무 에드온 개발 질문 [1] 2008.07.25 by 라르게덴
찢백 리플을 달수가 없어요... [1] file 2008.07.25 by 대암지기
철쌤 최근 버전으로 업데이트 후.. [2] 2008.07.25 by 대암지기
sharp294 하나의 게시물을 여러 페이지에 중복 노출되게 할 수 있을까요? [2] 2008.07.25 by sharp294
drake 관리자 서비스형 모듈 에서요. [1] 2008.07.25 by 대암지기
신아라 [애드온 관련]PHP수정 질문입니다.