Jeg har ikke et fuldstændigt system til dette formål, men jeg kan hjælpe dig godt på vej da jeg har lavet noget lignende engang.
Du kan læse om at uploade billeder her:
http://www.eksperten.dk/artikler/266En funktion til at resize:
function resize_jpg($img,$w,$h) {
global $filename, $archive_dir;
$thumb = imagecreatetruecolor ($w, $h);
$image = ImageCreateFromJpeg($img);
$imagedata = getimagesize($img);
imagecopyresized ($thumb, $image, 0, 0, 0, 0, $w, $h, $imagedata[0], $imagedata[1]);
$thumbfile = $archive_dir."/thumbs/thumb_".$filename;
imagejpeg($thumb, $thumbfile);
}
Og en til at skrive på billeder:
function writeText($img) {
global $archive_dir, $filename;
// create a 100*30 image
$image = imagecreate(100, 30);
$im = imagecreatefromjpeg($img);
// white background and blue text
$bg = imagecolorallocate($im, 0, 0, 0);
$textcolor = imagecolorallocate($im, 255, 255, 255);
list($width, $height) = getimagesize($img);
$string = "pacroon.dk";
// write the string at the top left
imagestring($im, 3, ($width-70), ($height-15), $string, $bg);
imagestring($im, 3, ($width-71), ($height-16), $string, $textcolor);
imagejpeg($im,$archive_dir."/".$filename);
}
I den form du laver, skal du så bare specificere hvor filen du har uploadet ligger, som fx det her:
if($_POST["Submit"] == "Submit") {
$filename = $_POST['filename']
$thumbfile = "/sti/til/".$filename."";
upload_file();
resize_jpg($thumbfile, $width, $height);
writeText($thumbfile);
}
Det kan måske hjælpe dig lidt på vej.