This works well now, only problem is the shadow is just black only! what can i do to make it more like a shadow
<?php
$filename = "http://www.mysite.com/travel/$folder/$pname";
/// START RESIZE
$off_site = $filename;
$fp = fopen ($off_site, 'rb') or die('Unable to open file '.$off_site.' for reading');
$buf = '';
while (!feof ($fp))
{
$buf .= fgets($fp, 4096);
}
header('Content-Type: image/jpeg');
$data = $buf;
$src = imagecreatefromstring ($data);
$width = imagesx($src);
$height = imagesy($src);
$aspect_ratio = $height/$width;
$aspect_ratio2 = $width/$height;
if ($size == "M") {
if ($height > $width) {
$new_h = 640;
$new_w = 480;
} else {
$new_w = 640;
$new_h = 480;
}
} elseif ($size == "L") {
if ($height > $width) {
$new_h = 960;
$new_w = 720;
} else {
$new_w = 960;
$new_h = 720;
}
} elseif ($size == "S") {
if ($height > $width) {
$new_h = 240;
$new_w = 180;
} else {
$new_w = 180;
$new_h = 240;
}
}
$img = imagecreatetruecolor ($new_w,$new_h);
imagecopyresampled ($img,$src,0,0,0,0,$new_w,$new_h,$width,$height);
/// ADDING WIDE ///
define("DS_OFFSET", 5);
define("DS_STEPS", 20);
define("DS_SPREAD", 1);
$nwidth = $new_w + DS_OFFSET;
$nheight = $new_h + DS_OFFSET;
$image = imagecreatetruecolor($nwidth, $nheight);
$background = array("r" => 255, "g" => 255, "b" => 255);
$background = array("r" => 255, "g" => 255, "b" => 255);
$current_color = $background;
for ($i = 0; $i <= DS_STEPS; $i++) {
$color[$i] = imagecolorallocate($image, round($current_color["r"]), round($current_color["g"]), round($current_color["b"]));
$current_color["r"] -= $step_offset["r"];
$current_color["g"] -= $step_offset["g"];
$current_color["b"] -= $step_offset["b"];
}
imagefilledrectangle($image, 0,0, $nwidth, $nheight, $colors[0]);
for ($i = 0; $i < count($colors); $i++) {
imagefilledrectangle($image, DS_OFFSET, DS_OFFSET, $nwidth, $nheight, $colors[$i]);
$nwidth -= DS_SPREAD;
$nheight -= DS_SPREAD;
}
//// FINISH WIDE ///
imagecopymerge($image, $img, 0,0, 0,0, $width, $height, 100);
imagejpeg($image, '', 90);
imagedestroy($img2);
?>