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.
more info about the class
include('../includeClasses/class.upload.php'); $files = array(); foreach ($_FILES['insert'] as $k => $l) { foreach ($l as $i => $v) { if (!array_key_exists($i, $files)) $files[$i] = array(); $files[$i][$k] = $v; } } $t=1; foreach ($files as $file) { $handle = new Upload($file); if ($handle->uploaded) { $handle->image_convert = 'jpg'; $handle->jpeg_quality = 80; $handle->file_max_size = '40000000'; $handle->Process("../images/unprocessed/"); $handle->image_convert = 'jpg'; $handle->jpeg_quality = 80; $handle->image_resize = true; $handle->image_ratio_y = true; $handle->image_x = 140; $handle->image_text = 'eLaHoL'; $handle->image_text_direction = 'v'; $handle->image_text_font = 2; $handle->image_text_position = 'BL'; $handle->image_text_padding_x = 2; $handle->image_text_padding_y = 8; $handle->file_max_size = '40000000'; $handle->Process("../images/thumbs/"); $handle->image_convert = 'jpg'; $handle->jpeg_quality = 80; $handle->image_text = 'eLaHoL'; $handle->image_text_direction = 'v'; $handle->image_text_percent = '100'; $handle->image_text_x = '12'; $handle->image_text_y = '12'; $handle->image_text_font = 10; $handle->image_text_percent = 80; $handle->image_text_position = 'BL'; $handle->image_resize = true; $handle->image_ratio_y = true; $handle->image_x = 400; $handle->file_max_size = '40000000'; $handle->Process("../images/natural/"); } }