O.K.'; if (array_key_exists('php_errormsg',$GLOBALS) && strlen($GLOBALS['php_errormsg'])) { $ret = ''.$GLOBALS['php_errormsg'].''; $GLOBALS['php_errormsg'] = ''; } return $ret; } /****************************************************************************/ // private to function search_file() function _search_file($root,&$possible,$path='') { $sub = array(); //error_log("search_file($root,$path)",0); if ($dir = @opendir($root.$path.'/')) { while (($found = @readdir($dir)) !== false) { $type = @filetype($root.$path.'/'.$found); //error_log("search_file($root$path):$type=$found",0); switch( $type) { case 'file': $pos = strpos($found,'.'); if ( $pos !== false && ( strtolower(substr($found,$pos+1))=='jpg' || strtolower(substr($found,$pos+1))=='tif' ) ) { $possible[] = $root.$path.'/'.$found; //error_log("search_file($root$path) add:$path/$found",0); } break; case 'dir': if ( $found!='.' && $found!='..') { $sub[count($sub)] = $found; } break; } } @closedir($dir); foreach( $sub as $idx => $found) { _search_file($root,$possible,$path.'/'.$found); } } } /****************************************************************************/ // function: search_file($file,$ext) // // Searches for $file in document tree. The path is ignored. // function search_file() { global $argv; $possible = array(); if ( array_key_exists('SCRIPT_FILENAME',$_SERVER)) { $path = $_SERVER['SCRIPT_FILENAME']; //error_log("SCRIPT_FILENAME($path)",0); } else { $path = $argv[0]; //error_log("argv($path)",0); } if ( ($p=strpos($path,'?')) !== false) $path = substr($path,0,$p); if ( ($p=strrpos($path,'/')) < strlen($path)-1) $path = substr($path,0,$p); _search_file($path,$possible); return $possible; } /****************************************************************************/ // function: search_file($file,$ext) // // Searches for $file in document tree. The path is ignored. // function AddInfo($Name,$Value) { $Value = nl2br($Value); return "$Name$Value \n"; } $possible = search_file(); $title = "PHP module exif test page"; ?> <?=$title ?>

(c) Marcus Boerger, 2002

Images taken from www.exif.org, marcus-boerger.de all rights reserved by their authors and artists, see exif headers. The files can be downloaded here. To start the test you simple have to put all images into the same directory as this script. The test will work with all files in that directory and all subdirectories. To test private images just put them into that directory.

Youmay take a look at the test source here.

This test just prooves that some exif headers can be scanned. If all files produce a header in output the module might be o.k.

What to look for in detail:

function exif_headername

\n"; } ?>
ImageWidth
JPEGProc
SceneType
false
function exif_headername is not supported

function exif_read_data for images

$file) { $num++; $res = ''; $len = 2; error_log("exif_read_data($file,'COMMENT,IFD0,EXIF,APP12');",0); $image = exif_read_data($file,'COMMENT,IFD0,EXIF,APP12'); $error = error_msg(); //error_log("exif_read_data($file)",0); if ( $image === false) { $error = 'exif_read_data returned false
'.$error; } else { foreach($image as $Name => $Value) { if ( $Name!='Thumbnail') { if ( is_array($Value)) { $len++; $res .= AddInfo($Name,'Array('.count($Value).')'); foreach( $Value as $idx => $Entry) { $len++; $res .= AddInfo($Name.':'.$idx,$Entry); } } else { $len++; $res .= AddInfo($Name,$Value); } } } } echo "\n$res"; } } else { echo "\n"; } ?>
$num
$file$error
function exif_read_data is not supported