My php program to resize an jpeg image is as follows,
?php
// File and new size
$filename = '\bala\testPHP\Lavanya\Kids2.jpeg';
//$filename = 'Kids2.jpeg';
$percent = 0.5;
// Content type
//header('Content-type: image/jpeg');
// Get new sizes
list($width, $height) = @getimagesize($filename);
echo getimagesize($filename);
$newwidth = $width * $percent;
$newheight = $height * $percent;
echo "step";
// Load
//$thumb = imagecreatetruecolor($newwidth, $newheight);
//echo "1 step";
$source= @imagecreatefromjpeg($filename);
$textcolor = imagecolorallocate($source, 0, 0, 255);
imagestring($source, 1, 5, 5, "Error loading $imgname",$textcolor);
//$source = imagecreatefromjpeg($filename);
echo "2 step";
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
imagejpeg($thumb);
echo "successfully completed";
?>
it returns the following error
getimagesize(\bala\testPHP\Lavanya\Kids2.jpeg): failed to open stream: No such file or directory in /home/bcns/public_html/bala/testPHP/Lavanya/imageprocess.php on line 13
step