yeah I know about the path,it's not the real path.
The files are moved to a directory using this🙁from another script):
copy($HTTP_POST_FILES['userfile']['tmp_name'], $path .
$HTTP_POST_FILES['userfile']['name']);
I tried the changes,but I still get the same error.
script:
<?
$im_file_name = '/original_pic/' . $_FILES['userfile']['name'];
$image_attribs = getimagesize($im_file_name);
if(in_array( $image_attribs[2], array('GIF', 'PNG', 'WBMP', 'XBM') ))
$im_old = call_user_func('imageCreateFrom' . $image_attribs[2], $im_file_name);
elseif($image_attribs[2] == 'JPG')
$im_old = imageCreateFromJpeg($im_file_name);
else
die('Source image is of unknown type!');
$th_max_width = 90;
$th_max_height = 90;
$ratio = ($width > $height) ? $th_max_width/$image_attribs[0] : $th_max_height/$image_attribs[1];
$th_width = $image_attribs[0] * $ratio;
$th_height = $image_attribs[1] * $ratio;
$im_new = imagecreatetruecolor($th_width,$th_height);
imageAntiAlias($im_new,true);
$th_file_name = '/thumbs/' . $_FILES['userfile']['name'];
imageCopyResampled($im_new,$im_old,0,0,0,0,$th_width,$th_height, $image_attribs[0], $image_attribs[1]);
(($image_attribs[2] == 'JPG') ? imageJpeg($im_new, $th_file_name, 100) : call_user_func('image' . $info[2], $im_new, $th_file_name));
chmod($th_file_name,0777)
?>