MGHosted.net
10-30-2004, 07:05 PM
Hey guys,
I have a form, you browse for an image and it puts it into your temp files. It then resizes it, and now I need it to be reuploaded to my /thumbnails/ folder. I don't know how, ive tried everything.
This is my code:
// File and new size
$filename = $_FILES['upload']['tmp_name'];
// Content type
header('Content-type: image/jpeg');
// Get Image sizes.
list($width, $height) = getimagesize($filename);
// Load
$thumb = imagecreatetruecolor(200, 150);
$source = imagecreatefromjpeg($filename);
// Resize
$resized = imagecopyresized($thumb, $source, 0, 0, 0, 0, 200, 150, $width, $height);
// Output
$fileoutput = imagejpeg($thumb);
Any help is appreciated
I have a form, you browse for an image and it puts it into your temp files. It then resizes it, and now I need it to be reuploaded to my /thumbnails/ folder. I don't know how, ive tried everything.
This is my code:
// File and new size
$filename = $_FILES['upload']['tmp_name'];
// Content type
header('Content-type: image/jpeg');
// Get Image sizes.
list($width, $height) = getimagesize($filename);
// Load
$thumb = imagecreatetruecolor(200, 150);
$source = imagecreatefromjpeg($filename);
// Resize
$resized = imagecopyresized($thumb, $source, 0, 0, 0, 0, 200, 150, $width, $height);
// Output
$fileoutput = imagejpeg($thumb);
Any help is appreciated
