<?php
/* Older versions of php4 don't have this function.
*
* Written by: Chris Studholme
* Copyright: GPL (http://www.fsf.org/copyleft/gpl.html)
* $Id: read_exif_data.php,v 1.1 2002/01/20 22:08:50 cstudhol Exp $
*/
function read_exif_data($path) {
$handle = fopen($path,"r");
if (!$handle)
return false;
$buf = fread($handle,12);
if (substr($buf,6,4)!="Exif")
return false;
$length = ord($buf[4])*256 + ord($buf[5]);
$data = fread($handle,$length-8);
$result = array();
if (ereg("([12][0-9][0-9][0-9]:[01][0-9]:[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9])",substr($data,264,19),$regs)) {
$result["DateTime"]=$regs[1];
}
fclose($handle);
return $result;
}
?>