[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/ezimage/classes/ -> ezexifimageanalyzer.php (source)

   1  <?php
   2  //
   3  // Definition of eZEXIFImageAnalyzer class
   4  //
   5  // Created on: <03-Nov-2003 15:19:16 amos>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  /*! \file ezexifimageanalyzer.php
  30  */
  31  
  32  /*!
  33    \class eZEXIFImageAnalyzer ezexifimageanalyzer.php
  34    \ingroup eZImageAnalyzer
  35    \brief Analyzes image formats which can contain EXIF information.
  36  
  37  */
  38  
  39  class eZEXIFImageAnalyzer
  40  {
  41      /*!
  42       Constructor
  43      */
  44      function eZEXIFImageAnalyzer()
  45      {
  46      }
  47  
  48      /*!
  49       \reimp
  50       Checks the file for EXIF data and returns the information.
  51      */
  52      function process( $mimeData, $parameters = array() )
  53      {
  54          $printInfo = false;
  55          if ( isset( $parameters['print_info'] ) )
  56              $printInfo = $parameters['print_info'];
  57  
  58          $filename = $mimeData['url'];
  59          if ( file_exists( $filename ) )
  60          {
  61              if ( function_exists( 'exif_read_data' ) )
  62              {
  63                  $exifData = exif_read_data( $filename, "COMPUTED,IFD0,COMMENT,EXIF", true );
  64                  if ( $exifData )
  65                  {
  66                      $info = array();
  67                      if ( isset( $exifData['COMPUTED'] ) )
  68                      {
  69                          foreach ( $exifData['COMPUTED'] as $key => $item )
  70                          {
  71                              if ( strtolower( $key ) == 'html' )
  72                                  continue;
  73                              $info[$key] = $exifData['COMPUTED'][$key];
  74                          }
  75                      }
  76                      if ( isset( $exifData['IFD0'] ) )
  77                      {
  78                          $info['ifd0'] = $exifData['IFD0'];
  79                      }
  80                      if ( isset( $exifData['EXIF'] ) )
  81                      {
  82                          $info['exif'] = $exifData['EXIF'];
  83                      }
  84                      return $info;
  85                  }
  86              }
  87          }
  88          return false;
  89      }
  90  
  91  }
  92  
  93  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7