class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
The following code returns "image resized" message but doesn't work. I have a file already on the server and this code somehow deletes it but doesn't replace it:
$handle=new upload(getcwd().$this->output_folder.$this->file_name.".".$file_info["extension"]); if ($handle->uploaded) { $handle->image_resize = $this->resize; $handle->image_x = $this->max_width; $handle->image_y = $this->max_height; $handle->file_overwrite = $this->overwrite; $handle->process(getcwd().$this->output_folder); if ($handle->processed) { echo 'image resized'; $handle->clean(); } else { echo 'error : ' . $handle->error; } }I am trying to resize and then overwrite the existing image.