I use the following function to create a thumbnail from an image just uploaded :
function resizeImage($filename){
list($width, $height) = getimagesize($filename);
$newwidth = 100;
$newheight = 100;
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
return imagejpeg($thumb);
}
This code works fine. My problem lies in how to then get the generated image onto my server ? I don't know what function to use.
I am peforming the function "resizeImage" immediately before I do a "move_uploaded_file" on the original file.
Any help is much appreciated.