All pastes #956326 Raw Edit

Stuff

public text v1 · immutable
#956326 ·published 2008-03-25 05:04 UTC
rendered paste body
<?

if (isset($_GET['t'])) {
	$name = "./".$_GET['t'].".jpg";
	$image = exif_thumbnail($name, $width, $height, $type);
	if ($image) {
	    // send header and image data to the browser:
	    header('Content-type: ' .image_type_to_mime_type($type));
		print $image;
		die();
	} else {
		die();
	}
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>sponge's PDA Camera</title>
	<style type="text/css">
	.pic { display: inline; width: 150px; height: 150px; }
	img { border: 1px solid black; }
	</style>
</head>
<h1>sponge's PDA Camera</h1>
<p>A whole new world in stalking! Check out my mobile phone pictures almost instantly after I take them! (A script running on my Windows Mobile phone launches the built-in camera app, waits until I take a picture and close the program, connects to the internet, and runs a python script to upload any new images it finds). The script also has the ability to pull in GPS coordinates, however I don't personally use them since the built-in GPS is rather weak.</p>

<div style="text-align: center;">
<?
date_default_timezone_set("EST");
$dir = scandir('.',1);
foreach ($dir as $file)
{
	if (substr($file,-3,3) == "jpg") {
	/*	$info = exif_read_data($file, $imageinfo);
		$finalstr = '';
    if (is_array($imageinfo)) {
		$iptc = iptcparse($imageinfo["APP13"]);
		$lat = $iptc['2#200'][0];
		if ($iptc['2#200'][0] != '') {
			$lon = $iptc['2#201'][0];
			$latstr = substr($lat,0,3)."&deg;".substr($lat,3,2)."'".substr($lat,6,1).'.'.substr($lat,7);
			$lonmin = (double) substr($lon,4);
			$lonmin += 0.03;
			$lonstr = substr($lon,0,4)."&deg;".$lonmin."'";
			$url = urlencode($latstr." ".$lonstr);
			$finalstr = "<a href=\"http://maps.google.com/?q=$latstr $lonstr\">GPS: $latstr, $lonstr</a>";
		}
	}*/
		$exif = exif_read_data($file);
		#print_r($exif);
		$time = $exif['DateTimeOriginal'];
		$thumb = "?t=".substr($file,0,-4);
		#$thumb = "rescale.php?img=".substr($file,0,-4);
		echo "<a href='$file'><img src='$thumb' alt='$time' title='$time'/></a>\n";
  }
}
?>
</div>
</html>