Change the Width of a Picture


Current Image:

My Dog

Select Width Change (0 = no change, 5 = Max Change)

Width Determination:

0   1   2   3   4   5  





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$image0000$width$height$width_orig$height);

// set the header for the new image
header("Content-type: image/jpeg");
imagejpeg($new_image);
imagedestroy($new_image);

?>