웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
EXIF 메타정보 필요하신 분 있으시면
2018.04.09 15:04
<?php // This function is used to determine the camera details for a specific image. It returns an array with the parameters. function cameraUsed($imagePath) { // Check if the variable is set and if the file itself exists before continuing if ((isset($imagePath)) and (file_exists($imagePath))) { // There are 2 arrays which contains the information we are after, so it's easier to state them both $exif_ifd0 = read_exif_data($imagePath ,'IFD0' ,0); $exif_exif = read_exif_data($imagePath ,'EXIF' ,0); $exif_makernote = read_exif_data($imagePath ,'MAKERNOTE' ,'UndefinedTag'); //MAKERNOTE.UndefinedTag:0x0095: EF24-70mm f/2.8L II USM //error control $notFound = "Unavailable"; // Makernote if (@array_key_exists('UndefinedTag', $exif_makernote)) { $camMakenote = $exif_makernote['UndefinedTag']; } else { $exif_makernote = $notFound; } //$return['makernote'] = $camMakernote; // Make if (@array_key_exists('Make', $exif_ifd0)) { $camMake = $exif_ifd0['Make']; } else { $camMake = $notFound; } // Model if (@array_key_exists('Model', $exif_ifd0)) { $camModel = $exif_ifd0['Model']; } else { $camModel = $notFound; } // Exposure if (@array_key_exists('ExposureTime', $exif_ifd0)) { $camExposure = $exif_ifd0['ExposureTime']; } else { $camExposure = $notFound; } // Aperture if (@array_key_exists('ApertureFNumber', $exif_ifd0['COMPUTED'])) { $camAperture = $exif_ifd0['COMPUTED']['ApertureFNumber']; } else { $camAperture = $notFound; } // Date //파일날자 if (@array_key_exists('DateTime', $exif_ifd0)) { $camDate = $exif_ifd0['DateTime']; } else { $camDate = $notFound; } // Date2 if (@array_key_exists('DateTimeOriginal', $exif_exif)) { $camDate2 = $exif_exif['DateTimeOriginal']; } else { $camDate2 = $notFound; } // ISO if (@array_key_exists('ISOSpeedRatings',$exif_exif)) { $camIso = $exif_exif['ISOSpeedRatings']; } else { $camIso = $notFound; } //Software if (@array_key_exists('Software', $exif_ifd0)) { $camSoft = $exif_ifd0['Software']; } else { $camSoft = $notFound; } //FocalLength if (@array_key_exists('FocalLength', $exif_exif)) { $camFocal = $exif_ifd0['FocalLength']; } else { $camFocal = $notFound; } //Height if (@array_key_exists('Height', $exif_ifd0['COMPUTED'])) { $camHeight = $exif_ifd0['COMPUTED']['Height']; } else { $camHeight = $notFound; } //Widht if (@array_key_exists('Width', $exif_ifd0['COMPUTED'])) { $camWidth = $exif_ifd0['COMPUTED']['Width']; } else { $camWidth = $notFound; } $return = array(); $return['make'] = $camMake; $return['model'] = $camModel; $return['makernote'] = $camMakernote; $return['exposure'] = $camExposure; $return['aperture'] = $camAperture; //$return['date'] = $camDate; //파일날자 $return['iso'] = $camIso; $return['soft'] = $camSoft; $return['focal'] = $camFocal; $return['height'] = $camHeight; $return['width'] = $camWidth; $return['date2'] = $camDate2; return $return; } else { return false; } } ?>
<include target="/home/hosting_users/******/www/_data/exif/exif.php" />
{@ $imagePath=$file->uploaded_filename; $img_size=getimagesize($imagePath); $file_size=filesize($imagePath); $file_size3=number_format($file_size); $camera = cameraUsed($imagePath); //echo "사용기종 : " . $camera['make'] . " " . $camera['model'] . " | "; echo "사용기종 : " . $camera['model'] . " | "; //echo "사용렌즈 : " . $camera['makernote'] . " | "; echo "노출시간 : " . $camera['exposure'] . " | "; echo "조리개 : " . $camera['aperture'] . " | "; echo "ISO : " . $camera['iso'] . " | "; echo "초점거리 : " . $camera['focal'] . " | "; //echo "Software : " . $camera['soft'] . " | "; echo "촬영일자 : " . $camera['date2'] . " | "; //echo "해상도 : ".$camera['width'] ."x". $camera['height']; echo "해상도 : ".$img_size[0]."x".$img_size[1]." px" . " | "; //echo $img_size[3]; echo "파일크기 : ".$file_size3." byte"; //return FileSizeConvert($imagePath); }
exif 출력 애드온이 제대로 작동하지않길래 php.net 에서 샘플을 긁어오고 살을 조금붙여서 사용하고있습니다.
잘 작동하네요 ^^
태그 연관 글
- [2010/11/22] 묻고답하기 도와주세요 ㅠ..ㅠ ; DQ_LIBS/include 폴더에서 파일하나를 삭제했는데
댓글 0
제목 | 글쓴이 | 날짜 |
---|---|---|
회원 정보에 내 포인트 현황 출력하기 [3] | 화랑529 | 2013.01.08 |
게시판 설정의 게시판 정보 탭에서, 고급 항목이 항상 노출되도록 하는 방법 [3] | sejin7940 | 2014.01.20 |
관리자를 제외하고는 타회원의 회원정보 보기를 막는 방법 [1] | sejin7940 | 2014.04.04 |
비회원 GPS 정보 처리 | 웹빌드ver2 | 2014.05.09 |
유저가 자신의 회원정보 전체를 공개/비공개 설정하게 하는 방법 [2] | sejin7940 | 2014.05.27 |
회원정보에서 '서명' 수정이 반영되지 않을 경우 | Novelic | 2014.06.03 |
홈페이지 제작 시, 개인정보관련/회원가입약관 처리에 대해서 [1] | 양파F | 2014.08.23 |
관리자페이지의 '서버정보출력'에 '절대경로' 가 출력되게 하는 방법 [3] | sejin7940 | 2014.08.26 |
회원정보보기시 공개 안 한 정보에 대해서도 최고관리자는 볼 수 있도록 변경 | sejin7940 | 2014.09.10 |
익명게시판에서 임시저장된 글을 불러와 등록하면 익명처리되지 않고 글쓴이 정보가 기록되는 버그 수정 [1] | sejin7940 | 2015.01.23 |
사용자 매뉴에 회원정보와 포인트설정 바로가기 기능 삽입 [1] | 간장게장같은남자 | 2015.01.23 |
아마존 상품API 소스中 상품정보 가져오는 소스 | 키스투엑스이 | 2015.03.10 |
회원정보보기를 팝업으로 띄우는 방법 | 콜롬보. | 2015.03.13 |
(오류x, 정보)ckeditor와 xpresseditor의 서식은 서로 다르네요. 반응형만드실 때 주의하실 필요가 있겠습니다. | 큰성565 | 2015.06.04 |
외부 페이지에서 회원 프로필 정보(확장변수) 나타내기 | 한꼬마 | 2015.10.14 |
[자료실 모듈] 경로 사용 해제후에 자료 정보 수정시 경로값 필요 문구 발생시 | 불금 | 2015.10.18 |
EXIF 메타정보 필요하신 분 있으시면 | forest535 | 2018.04.09 |