개발人

Exif보는 무료콤포넌트 | ASP/SQL 본문

Classic ASP

Exif보는 무료콤포넌트 | ASP/SQL

NJHouse 2015. 5. 23. 19:15
반응형

콤포넌트명:JwPhoto.dll

제작사:http://www.jwsoft.co.kr/pds/jwsoft/


설치법>

JwPhotoInfo.dll 을 웹서버에 설치 하기

   JwPhoto 를 다운로드 받아서 압축을 풀면, JwPhotoInfo.dll 이 있습니다. 이 파일을 웹 서버에 설치 하기 위해서는

   다음과 같이 하시면 됩니다.

 

   1-1. 폴더 생성 및 파일 복사

        해당 디스크의 Program Files 폴더로 이동하여 JWSoft 라는 폴더를 생성 합니다.

        JWSoft 폴더에 JwPhotoInfo.dll 을 복사 합니다.

 

   1-2. JwPhotoInfo.dll 등록

        콘솔 command 창으로 JWSoft 폴더 까지 이동 후, 다음과 같은 명령어를 실행 합니다.

       C:\Program Files\JWSoft> regsvr32 JwPhotoInfo.dll
        다음과 같이 하시면, JwPhotoInfo.dll 이 웹서버에 등록 됩니다.


   1-3. JwPhotoInfo.dll 제거

        만약 JwPhotoInfo.dll 등록을 해제 하고 싶다면 regsvr32 /u JwPhotoInfo.dll 한 다음,

        파일을 삭제 하시면 됩니다.

 



 예제>

case asp

<%
   '--JwPhoto Test --------------

    loadPath = Server.MapPath("DSCN0526.JPG")

    Set objPhoto = Server.CreateObject("JWPHOTOINFO.PhotoInfo")

    ' 파일을 load 한다.
    objPhoto.LoadImagePath = loadPath

    if objPhoto.IsExif=1 then
        Response.Write "카메라 : " + objPhoto.CameraMaker + " " + objPhoto.CameraModel + "<BR>"
        Response.Write "촬영일 : " + objPhoto.DateTime + "<BR>"
        Response.Write "exif 버전 : " + objPhoto.Version + "<BR>"
        Response.Write "해상도 : " + CStr(objPhoto.Width) + " x " + CStr(objPhoto.Height) + "<BR>"
        Response.Write "X resolution(dpi) : " + objPhoto.Xresolution_dpi + "<BR>"
        Response.Write "Y resolution(dpi) : " + objPhoto.Yresolution_dpi + "<BR>"

        if objPhoto.FlashUsed=1 then
            Response.Write "플래시 yes <BR>"
        else
            Response.Write "플래시 no <BR>"
        end if

        Response.Write "초점거리 : " + objPhoto.FocalLength + "<BR>"
        Response.Write "셔터속도 : " + objPhoto.ExposureTime + "<BR>"
        Response.Write "조리개값 : " + objPhoto.ApertureFNumber + "<BR>"
        Response.Write "ISO 크기 : " + objPhoto.ISOequivalent + "<BR>"
        Response.Write "촬영시 좌우회전 : " + objPhoto.Orientation + "<BR>"
        Response.Write "노출보정 : " + objPhoto.ExposureBias + "<BR>"
        Response.Write "화이트 발란스 : " + objPhoto.Whitebalance + "<BR>"
        Response.Write "측광방식 : " + objPhoto.MeteringMode + "<BR>"
        Response.Write "촬영모드 : " + objPhoto.ExposureProgram + "<BR>"
        Response.Write "압축율 : " + objPhoto.CompressionLevel + "<BR>"
        Response.Write "Brightness : " + objPhoto.Brightness + "<BR>"
        Response.Write "Distance : " + objPhoto.Distance + "<BR>"

        if objPhoto.IsColor=0 then
            Response.Write "색상 : 흑백 <BR>"
        else
            Response.Write "색상 : 컬러 <BR>"
        end if

    end if

    Set objPhoto = Nothing
  %>


case asp.net(C#)

   using System;
   using System.Web;
   using JWPHOTOINFOLib;

   namespace TestNET.test
   {
      public class loadexif : System.Web.UI.Page
      {
         public bool m_exif=false; // 사진촬영정보 여부

         // 사진 Exif 정보 얻기
         public string m_cameraName="&nbsp;", m_model="&nbsp;", m_wdate="&nbsp;";
         public string m_version="&nbsp;", m_size="&nbsp;";
         public string m_xdip="&nbsp;", m_ydpi="&nbsp;", m_flash="&nbsp;";
         public string m_focal="&nbsp;", m_expo_time="&nbsp;";
         public string m_apert="&nbsp;", m_iso="&nbsp;", m_orient="&nbsp;";
         public string m_expo_bias="&nbsp;", m_wbalrance="&nbsp;";
         public string m_meterMode="&nbsp;", m_expo_prog="&nbsp;";
         public string m_quality="&nbsp;", m_bright="&nbsp;", m_distance="&nbsp;";
         public string m_iscolor="&nbsp;";

         string m_filepath="";

         private void Page_Load(object sender, System.EventArgs e)
         {
            // 촬영정보
               getExif();
         }

         public void getExif() {
               JWPHOTOINFOLib.IPhotoInfo objPhoto;


               try {
                  objPhoto = new JWPHOTOINFOLib.PhotoInfo();
                  m_filepath = "DSCN0526.JPG";
                  objPhoto.LoadImagePath = Request.MapPath(m_filepath);


                  if(objPhoto.IsExif==1) {
                     m_exif = true;
                     m_cameraName = objPhoto.CameraMaker.Trim();                    // 카메라
                     m_model = objPhoto.CameraModel.Trim();                           // 모델
                     m_wdate = objPhoto.DateTime;                                      // 촬영일
                     m_version = objPhoto.Version.Trim();                                // exif 버젼
                     m_size = objPhoto.Width.ToString()+" x "+objPhoto.Height.ToString();   // 해상도
                     m_xdip = objPhoto.Xresolution_dpi.Trim();                            // X resolution
                     m_ydpi = objPhoto.Yresolution_dpi.Trim();                            // Y resolution


                     if(objPhoto.FlashUsed==1) m_flash = "Yes";                           // 플래시 사용 여부
                     else m_flash = "No";


                     m_focal = objPhoto.FocalLength;                                     // 초점거리
                     m_expo_time = objPhoto.ExposureTime.Trim();                       // 셔터속도
                     m_apert = objPhoto.ApertureFNumber.Trim();                         // 조리개값
                     m_iso = objPhoto.ISOequivalent.Trim();                               // ISO 크기
                     m_orient = objPhoto.Orientation.Trim();                               // 촬영시 좌우회전
                     m_expo_bias = objPhoto.ExposureBias.Trim();                       // 노출보정
                     m_wbalrance = objPhoto.Whitebalance.Trim();                        // 화이트 밸런스

                     m_meterMode = objPhoto.MeteringMode.Trim();                      // 측광방식
                     m_expo_prog = objPhoto.ExposureProgram.Trim();                   // 촬영모드
                     m_quality = objPhoto.CompressionLevel.Trim();                      // 압축율
                     m_bright = objPhoto.Brightness.Trim();                               // Brightness
                     m_distance = objPhoto.Distance.Trim();                              // Distance


                     if(objPhoto.IsColor==0) m_iscolor = "흑백";                             // 컬러/흑백
                     else m_iscolor = "컬러";
                  }
              } catch (Exception ex) {return;}
          }
     }
}



반응형

'Classic ASP' 카테고리의 다른 글

세션 timeout 설정방법  (0) 2015.05.23
로그인시 로그인한 후 이전페이지로 돌려주기  (0) 2015.05.23
Request에서 제공하는 ServerVariables  (0) 2015.05.23
Do~Loop 구문  (0) 2015.05.23
For ~ Next 구문  (0) 2015.05.23
Comments