Change the Width of a Picture
Current Image:
Select Width Change (0 = no change, 5 = Max Change)
SLAVE CODE FOLLOWS
<?php // skinny script
$skinny = $_GET['sk'];
// get the images from files
$image = imagecreatefromjpeg("../images/elle.jpg");
// get sizes of original
$width_orig = imagesx($image);
$height = imagesy($image);
// adjust the width for the new image
$width = $width_orig - ($width_orig * $skinny * .05);
// create a new image
$new_image = imagecreatetruecolor($width, $height);
// resample old to new image
imagecopyresampled($new_image, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height);
// set the header for the new image
header("Content-type: image/jpeg");
imagejpeg($new_image);
imagedestroy($new_image);
?>