NogDog;10883506 wrote:Maybe we need to see the code that does not work?
This is my working code, I've tried to change filename to be
"
$filename = "C:\Photos\$file";
But it does not work even thought this is the file location on my hard drive....
$file = $_GET['file'];
$filename = "http://www.mysite.com/photos/$file";
$degrees = $_GET['degrees'];
// Content type
header('Content-type: image/jpeg');
// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = 570;
$newheight = 365;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
define("DS_OFFSET", 5);
define("DS_STEPS", 10);
define("DS_SPREAD", 1);
$width = $newwidth + DS_OFFSET;
$height = $newheight + DS_OFFSET;
$image = imagecreatetruecolor($width, $height);
$background = array("r" => 255, "g" => 255, "b" => 255);
$step_offset = array("r" => ($background["r"] / DS_STEPS), "g" => ($background["g"] / DS_STEPS), "b" => ($background["b"] / DS_STEPS));
$current_color = $background;
for ($i = 0; $i <= DS_STEPS; $i++) {
$colors[$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, $width, $height, $colors[0]);
for ($i = 0; $i < count($colors); $i++) {
imagefilledrectangle($image, DS_OFFSET, DS_OFFSET, $width, $height, $colors[$i]);
$width -= DS_SPREAD;
$height -= DS_SPREAD;
}
imagecopymerge($image, $thumb, 0,0, 0,0, $newwidth, $newheight, 100);
$image2 = imagerotate($image, $degrees, 0);
imagejpeg($image2, "", 90);
?>