thanks for your fast reply!
I'm using ImageCopyResized(). Is that a bad choice?
actual code:
$tmp_image=imagecreatefromjpeg($_FILES['image']['tmp_name']);
$width = imagesx($tmp_image);
$height = imagesy($tmp_image);
$new_width=80;
$new_height= round(($height/$width)*$new_width);
$new_image = imagecreatetruecolor($new_width,$new_height);
ImageCopyResized($new_image, $tmp_image,0,0,0,0, $new_width, $new_height, $width, $height);
//Grab new image
ob_start();
ImageJPEG($new_image,NULL,100);
$image_buffer = ob_get_contents();
ob_end_clean();
ImageDestroy($new_image);
//Create temporary file and write to it
$thumb = tmpfile();
fwrite($thumb, $image_buffer);
rewind($thumb);