웹마스터 팁
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
제목 | 글쓴이 | 날짜 |
---|---|---|
[전면수정]회원가입시 기본 정보공개 여부 체크하기(1) 모듈부분 [5] | 대암지기 | 2008.02.20 |
[전면수정]회원가입시 기본 정보공개 여부 체크하기(2) 스킨부분 | 대암지기 | 2008.02.17 |
본인외 회원정보 제어 [1] | edgarkim | 2008.02.03 |
회원가입시 추가 정보 입력한것이 안 보일때 [1] | 수지보더 | 2008.01.08 |
제로보드에서 로그인후 테크노트에서 로그인정보 사용하기 [4] | JinHoHan | 2007.12.26 |
외부프로그램(페이지)에서 zbxe 로그인 정보 연동하기
[33]
![]() | 도데군 | 2007.12.23 |
회원가입시 추가한 추가정보를 관리자와 회원자신만 보기... [5] | 지연아빠 | 2007.12.22 |
회원이 이름, 닉네임등 정보 변경 못하도록 하기 [8] | 지연아빠 | 2007.12.22 |
외부페이지에서 위젯사용하지 않고 로그인 정보 다루기. [5] [1] | 길치객 | 2007.12.12 |
(회원정보) 보기 페이지에서 포인트 변경하기
[4]
![]() | Simulz | 2007.11.28 |
글쓴이 이메일 정보 감추기 [2] | 대암지기 | 2007.11.22 |
외부 문서에서 회원 정보 얻는 방법 [11] | 소마세월 | 2007.11.10 |
첨부파일 기능에 대한 짧은 정보 [3] | 고라리 | 2007.11.09 |
메뉴에 "회원 정보 보기" 걸기. [4] | font | 2007.11.03 |
(회원 정보) 작성 글 수, 댓글 수를 보여주기 (#4, 2007-10-13)
[7]
![]() | Simulz | 2007.10.06 |
(포인트 모듈) 추가 정보 출력
[8]
![]() | Simulz | 2007.09.20 |
외부에서 회원정보 불러오기 [5] | 미오유 | 2007.08.15 |