00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 class eZEXIFImageAnalyzer
00042 {
00043
00044
00045
00046 function eZEXIFImageAnalyzer()
00047 {
00048 }
00049
00050
00051
00052
00053
00054 function process( $mimeData, $parameters = array() )
00055 {
00056 $printInfo = false;
00057 if ( isset( $parameters['print_info'] ) )
00058 $printInfo = $parameters['print_info'];
00059
00060 $filename = $mimeData['url'];
00061 if ( file_exists( $filename ) )
00062 {
00063 if ( function_exists( 'exif_read_data' ) )
00064 {
00065 $exifData = exif_read_data( $filename, "COMPUTED,IFD0,COMMENT,EXIF", true );
00066 if ( $exifData )
00067 {
00068 $info = array();
00069 if ( isset( $exifData['COMPUTED'] ) )
00070 {
00071 foreach ( $exifData['COMPUTED'] as $key => $item )
00072 {
00073 if ( strtolower( $key ) == 'html' )
00074 continue;
00075 $info[$key] = $exifData['COMPUTED'][$key];
00076 }
00077 }
00078 if ( isset( $exifData['IFD0'] ) )
00079 {
00080 $info['ifd0'] = $exifData['IFD0'];
00081 }
00082 if ( isset( $exifData['EXIF'] ) )
00083 {
00084 $info['exif'] = $exifData['EXIF'];
00085 }
00086 return $info;
00087 }
00088 }
00089 }
00090 return false;
00091 }
00092
00093 }
00094
00095 ?>