File: /home/awaldron/public_html/archive/demo/image.php
<?php
include("_functions.php");
if (isset($_GET["u"]) && isset($_GET["s"])) {
$u = $_GET["u"];
if (!file_exists("gui/photos/".$u.".jpg")) $u = "nophoto";
if ($_GET["s"] == 1) { $w = 60; $h = 85; }
if ($_GET["s"] == 2) { $w = 52; $h = 66; }
if ($_GET["s"] == 3) { $w = 44; $h = 55; }
// Grab Image
$image = new img_resize("gui/photos/".$u.".jpg");
// Create Top Story Size Image
$image->resize($w, $h, 0);
$data = $image->output_resized(FALSE);
// If Write Parameter was pass and is 1
if (isset($_GET["w"]) && ($_GET["w"] == 1)) {
$new_file = "gui/photos/".$u.$_GET["s"].".jpg";
$image->output_resized($new_file, "JPEG");
}
header( "Content-type: image/jpg");
echo $data;
}
?>