<?php
// File source
$filename = $_GET['image']; 

// Content type
header('Content-Type: image/jpeg');

// Dimensions
list($width, $height) = getimagesize($filename);
$new_width = 600;
$new_height = (600 * $height)/$width;

// Resample
$imagethumb = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($imagethumb, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);

// Output
imagejpeg($imagethumb, null, 80);

?> 