'; include('includes\config.inc.php'); include('includes\functions.inc.php'); $db_link = mysql_connect($db['host'],$db['user'],$db['pass']); mysql_select_db($db['name']); set_time_limit(200); $count = "0"; //@unlink($dir[upload].'/Thumbs.db'); if ($handle = opendir($dir['upload'].'/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && $file != "Thumbs.db") { $foutput .= '
'; $foutput .= "

$file

"; //echo $foutput; $exif = exif_read_data($dir['upload'].'/'.$file, 0, true); // exif waardes kopieren $image['artist'] = $exif['IFD0']['Artist']; $image['datetime'] = $exif['EXIF']['DateTimeOriginal']; $image['width'] = $exif['COMPUTED']['Width']; $image['height'] = $exif['COMPUTED']['Height']; $image['filetime'] = $exif['IFD0']['DateTime']; $size = @getimagesize($dir['upload'].'/'.$file, $info); if(isset($info['APP13'])) { $iptc = iptcparse($info['APP13']); } //iptc waardes kopieren $image['title'] = $iptc['2#105'][0]; $image['categorie'] = $iptc['2#015'][0]; $image['supp_categorie'] = $iptc["2#020"][0]; $image['city'] = $iptc["2#090"][0]; $image['country'] = $iptc["2#101"][0]; $tmp_ymd_iptc = $iptc["2#055"][0]; //Omschrijving scheiden van overige rommel aan het begin $new_discription = explode('- '.strtolower($image['supp_categorie']).' -',$exif['IFD0']['ImageDescription']); $image['discription'] = $new_discription[1]; $new_title = split('[:;]',$new_discription[0]); $foutput .= 'new title2 - '.$new_title[1].'
'; $foutput .= 'Discription volluit - '.$exif['IFD0']['ImageDescription'].'
'; if ($image['discription'] == '') $image['discription'] = $exif['IFD0']['ImageDescription']; if ($image['title'] == '') $image['title'] = $new_title[1]; if ($image['datetime'] == '' ) { if ($image['filetime'] != '') { $image['datetime'] = $image['filetime']; } else { if ($tmp_ymd_iptc != '') { $tmp_y = substr($tmp_ymd_iptc,0,4); $tmp_m = substr($tmp_ymd_iptc,4,2); $tmp_d = substr($tmp_ymd_iptc,6,2); $image['datetime'] = $tmp_y.':'.$tmp_m.':'.$tmp_d.' 00:00:00'; unset ($image['filetime']); } } } //10digit tijd genereren vanuit de camera tijd/datum list($jaar,$maand,$dag,$uur,$min,$sec) = split('[ :]',$image['datetime']); $image['time'] = mktime($uur,$min,$sec,$maand,$dag,$jaar); //nieuwe bestandsnaam genereren $image['old_filename'] = $file; $image['new_filename'] = $image['time'].$file; foreach ($image as $key => $val) { if ($val == '') $fnt = ''; else $fnt =''; $foutput .= $fnt.$key.' - '.$val.'
'; } $foutput .= '---- de EXIF data ------
'; foreach ($exif as $key => $section) { foreach ($section as $name => $val) { $foutput .= "$key.$name: $val
\n"; } } $foutput .= '------------------------
'; $foutput .= '---- de IPTC data ------
'; if (!empty($iptc)) foreach ($iptc as $key => $section) { foreach ($section as $name => $val) { $foutput .= "$key.$name: $val
\n"; } } $foutput .= '------------------------
'; $image['discription'] = str_replace("'","",$image['discription']); $image['discription'] = str_replace('"',"",$image['discription']); $foutput .= writeimage(); $img = explode('.',$image['new_filename']); $count++; } //unset($image); //unset($iptc); } // next image closedir($handle); } $fp = fopen('logfile/'.date('Y-m-d',time()).'.htm', 'a'); fwrite($fp, $foutput); fclose($fp); echo $foutput; ?>