Filter:   InfoImg
download read_exif_data.php
Language: PHP
LOC: 18
Project Info
Virtual Photo Album(vphotoalb)
Server: SourceForge
Type: cvs
...alb\vphotoalb\html\include\
   .htaccess
   antispam.php
   constants.php
   db.php
   db_my.php
   db_pg.php
   db_schema.php
   faq_strings.php
   form.php
   functions.php
   globals.php
   html.php
   html_verifier.php
   ImageProcessing.php
   input.php
   mime.php
   originals.php
   PictureFinder.php
   queries.php
   read_exif_data.php
   read_tiff_data.php
   SearchParameters.php
   security.php
   strings.en.php
   strings.fr.php
   strings.php
   tables.php

<?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;
}

?>