묻고답하기

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 남기남
키스미베이베 게시판 글쓴이 전부 다른사람으로 바꾸기...DB에서되려나... [1] 2012.06.04 by 송동우
엘엘 검색결과페이지의 타이틀제목을 변경하는 방법 [2] 2012.06.04 by 송동우
optimizer 로그인을 시도하면 "존재하지않는 사용자 아이디입니다" file  
마이꿈이 Couldn't find the requested module 메세지가 떠서 접속이 안되요  
nicerunner 알림쪽지 내용을 바꾸려면?? [1] 2012.06.03 by 러키군
이모사푸 모바일 댓글 역순으로 출력하기 알려주세요. [1] 2012.06.03 by 러키군
루노서비스 다른 서버랑 연동 시키는 방법 [1] 2012.06.03
nicerunner 신고하면 아무런 반응도없어요  
크루씨 php하고 mysql 모듈 문의올려요 ㅠㅠ [1] 2012.06.03
크루씨 아악';;;;; [1] 2012.06.03 by 데브위트™
자동차 이미지 이름 gif(움직이는 그림) 가능한가요? [1] 2012.06.03 by 송동우
RRYU 게시물에 읽을 권한 부여하는 방법 질문입니다. [1] file 2012.06.03 by 송동우
위태성 ruleset 사용법 질문(로그인 및 회원가입)  
제로보드 xe에서 [1] 2012.06.03 by sejin7940
단기종합 모바일페이지에서 추천/비추천버튼 나오게하는법 [1] 2012.06.03 by sejin7940
꿀꺽2 한줄 입력칸 길이 조절 방법 좀... [2] 2012.06.03 by sejin7940
충서엉 인증메일을 보냈다는 팝업이 갑자기 나오질 않네요...ㅠ,.ㅠ [1] 2012.06.03 by 크루씨
nicerunner "비밀글입니다." 라는 문구는 어디서 수정하나요? [1] 2012.06.03 by 크루씨
nicerunner 테두리 색깔바꾸기 [1] 2012.06.03 by 크루씨
단기종합 검색기능 문의