I have found a script that resizes an image upon upload which works
What i want to do is as well as create a thumbnail image, i want to create a larger image an dput it in a folder called large
I am having trouble getting the large image to create
Here is the code that works for the thumbnail creation
$im_file_name = 'pics/' . $_FILES['photo']['name'];
$image_attribs = getimagesize($im_file_name);
$im_old = imageCreateFromJpeg($im_file_name);
$th_max_width = 100;
$th_max_height = 75;
$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 = 'pics/thumbs/' . $_FILES['photo']['name'];
imageCopyResampled($im_new,$im_old,0,0,0,0,$th_width,$th_height, $image_attribs[0], $image_attribs[1]);
imageJpeg($im_new,$th_file_name,100);
I want to create an image 400 x 300 if that is possible