묻고답하기

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 남기남
Piao 싸이 미니홈피만 뜨게 하려면 어떻게 해야 하나요? [2] 2007.08.10
º 레카☆ º 나모.. 표에 줄추가에 관한 질문 ^^ (상세스샷 포함) [6] 2007.08.10
씨드 도대체 xml(xthml) 이놈 뭡니까..-_;; [2] 2007.08.10
오진석 초보에요 [1] 2007.08.10
하이루 카운터 어디서 왔는지 확인 추가하는법좀. . [1] 2007.08.10
비공개 홈피 레이아웃에 보면 PSD 파일있잖아요.. [4] 2007.08.10
이황진 드레그 할때 움직이지않는 고정 창 방법? [1] 2007.08.10
하이루 제로 카운터 이미지화 시키는거 설명좀. .;; [1] 2007.08.10
Karekano 홈페이지,, 테이블 질문인데요,,! [2] 2007.08.10
swing3 mysql 실행하고 패스워드 변경하려고 하는데요,, [4] 2007.08.10
jin 일러스트 파일을 플래시로 임포트시킬때... [1] 2007.08.10
임소식 표안의 표의 투명도 조절.. [1] 2007.08.10
느끼남 Strict, Transitional, Frameset의 차이점을 알려주세요.  
이희영 인터넷 연결에 대한 질문.. [3] 2007.08.10
황일섭 노프레임 만들다가 문제 발생했습니다... [3] 2007.08.10
물렁이 일반페이지에 사용권한 넣기 [1] 2007.08.10
pray 이건 정말 인터넷 관련 질문인데요 ㅠ [4] 2007.08.10
윤여동 새창 띄우기 질문입니다.  
김성필 다시질문드립니다. 새로작업한파일을 올렸는데, 페이지가 깨져 버려요...ㅠ.,ㅜ [1] 2007.08.10
Karekano 아,, 테이블 관련 질문입니다... [6] 2007.08.10