<html>
<head></head>
<body>
<table>
<?php
// define directory path
$dir = ".";
// iterate through files
// look for JPEGs
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (preg_match("/.jpg/", $file)) {
// read EXIF headers
$exif = exif_read_data($file, 0, true);
$str = "<tr>\n";
$str .= "<td valign=\"top\"><a href=\"$dir/$file\"><img src=\"thumbnail.php?file=$file\"></a></td>\n";
$str .= "<td valign=\"top\"><font size=\"-1\">";
$str .= "File: <b>" . $exif['FILE']['FileName'] . "</b><br>";
$str .= "Timestamp: " . $exif['IFD0']['DateTime'] . "<br>";
$str .= "Dimensions: " . $exif['COMPUTED']['Width'] . " x " . $exif['COMPUTED']['Height'] . " <br>";
$str .= "Camera: " . $exif['IFD0']['Model'] . "<br>";
$str .= "Latitude: " . $exif["GPS"]["GPSLatitudeRef"] . " " . $exif['GPS']['GPSLatitude'][0] . "-" . $exif['GPS']['GPSLatitude'][1] . "-" . $exif['GPS']['GPSLatitude'][2] . "<br>";
$str .= "Longitude: " . $exif["GPS"]["GPSLongitudeRef"] . " " . $exif['GPS']['GPSLongitude'][0] . "-" . $exif['GPS']['GPSLongitude'][1] . "-" . $exif['GPS']['GPSLongitude'][2];
$str .= "</font></td>\n";
$str .= "</tr>\n";
echo $str;
}
}
closedir($dh);
}
}
?>
</table>
</body>