Source for file rainExif.php

Documentation is available at rainExif.php

  1. <?
  2.  
  3. /**  
  4.  * »çÁø Exif Á¤º¸ °ü¸®
  5.  * @package com.rain
  6.  * @version 1.0
  7.  * @author http://cafen.net (outmind@cafen.net)
  8. */
  9. class rainExif {
  10.  
  11.     /**  
  12.      * »çÁø Á¤º¸
  13.      *
  14.      * @var rainProperties 
  15.     */
  16.     var $props = null;
  17.  
  18.     /**  
  19.      * »ý¼ºÀÚ
  20.      *
  21.      * @param  String  ´ë»ó À̹ÌÁö À̸§
  22.     */
  23.     function rainExif($fileName){
  24.         $exif_conf rainUtil::getConf("path_uploads")."thumb/" $fileName "_exifphp";
  25.         $this->props = new rainProperties($exif_conftrue);
  26.         if (!$this->props->file_loaded  && rainUtil::checkDir(rainUtil::getConf("path_uploads")"thumb/" $fileName "_exifphp")) {
  27.             $result @exif_read_data(rainUtil::getConf("path_uploads"$fileName);
  28.             $exif_info Array();
  29.             if (is_array($result)) {
  30.                 foreach($result as $key => $val{
  31.                     if (!in_array($keyArray('MakerNote','ComponentsConfiguration')) && !ereg('^UndefinedTag'$key&& !is_array($val&& trim($val!== ''
  32.                         $this->props->setProperty($keytrim($val));    
  33.                 }
  34.             }
  35.             $this->props->store($fileName);
  36.             $fm new rainFileManager($fileName);
  37.             $fm->add($fileName "_exifphp.ini");
  38.         }
  39.     }
  40.  
  41.     /**  
  42.      * Æ¯Á¤ Exif Á¤º¸ °¡Á®¿À±â
  43.      *
  44.      * @param      String  Exif Å±×À̸§
  45.      * @return     String Å±װª
  46.     */
  47.     function get($tag_name{
  48.         return $this->props->getProperty($tag_name);
  49.     }
  50.  
  51.     /**  
  52.      * Ä«¸Þ¶ó ±âÁ¾°¡Á®¿À±â
  53.      *
  54.      * @return String    Ä«¸Þ¶ó±âÁ¾
  55.     */
  56.     function getModel({
  57.         return $this->get("Model");
  58.     }
  59.  
  60.     /**  
  61.      * »çÁø ÃÔ¿µÀÏ °¡Á®¿À±â
  62.      *
  63.      * @return String    »çÁø ÃÔ¿µÀÏ
  64.     */
  65.     function getDatetime({
  66.         return $this->get("DateTime");
  67.     }
  68.  
  69.     /**  
  70.      * »çÁø ±âŸÁ¤º¸ °¡Á®¿À±â
  71.      *
  72.      * @return String    ISO Speed Ratings + Exposure Time + F-Number + Focal Length
  73.     */
  74.     function getInfo({
  75.         $info "";
  76.         if ($this->get("ISOSpeedRatings"== '')
  77.             return "";
  78.         $info .= $this->get("ExposureTime")."sec";
  79.         $info .= "  ISO" $this->get("ISOSpeedRatings""  ";
  80.         $info .= " F" $this->get("FNumber""  ";
  81.         $info .= $this->get("FocalLength""mm  ";
  82.         return $info;
  83.     }
  84.  
  85.     /**  
  86.      * Á¤»óº¸±â¸¦ À§ÇÑ ÇÊ¿äÇѠȸÀü°¢ °¡Á®¿À±â
  87.      *
  88.      * @return Int È¸Àü°¢ (0:ÇÊ¿ä¾øÀ½, 1: 90 µµ, 2 : 180µµ(´ëºÎºÐÀÇ Ä«¸Þ¶ó¿¡¼­ ÀÛµ¿¾ÈµÊ, »ç¿ë¾ÈÇÔ), 3 : 270µµ)
  89.     */
  90.     function getRotate({
  91.         $Orientation $this->get("Orientation");
  92.         switch($Orientation{
  93.             case :
  94.                 return 0;
  95.                 break;
  96.             case :
  97.                 return 1;
  98.                 break;
  99.             case :
  100.                 return 3;
  101.                 break;
  102.             default :
  103.                 return 0;
  104.                 break;
  105.         }
  106.     }    
  107.  
  108.     /**  
  109.      * Å±נÀ̸§ °¡Á®¿À±â
  110.      *
  111.      * @return Array    Å±נÀ̸§
  112.     */
  113.     function propertyNames({
  114.         return $this->props->propertyNames();
  115.     }
  116.  
  117.     /**  
  118.      * Å±נÀüü Á¤º¸ °¡Á®¿À±â
  119.      *
  120.      * @return String    Àüü Á¤º¸
  121.     */
  122.     function getAll({
  123.         $return_str $exif_key "";
  124.         foreach($this->propertyNames(as $exif_key{
  125.             $return_str .= $exif_key " = " $this->get($exif_key"\r\n";
  126.         }
  127.         return $return_str;
  128.     }
  129.     
  130.  
  131. }
  132.  
  133. ?>

Documentation generated on Mon, 17 Mar 2008 12:17:45 +0900 by phpDocumentor 1.4.0a2 | Copyright 2005 cafen.net