I had a friend help me with a script a while back that would take an image, save it as a random number that would never occur again, then make a copy of that image and resize it saving it as a png.
Here's my next question... I want to tag, or watermark i guess it would be called the fullsize image that is uploaded with a small logo (50px by 50px) on the bottom right corner of every pic... not the small thumbnail pic, just the full size one that is uploaded
make sense?
i dont know how hard it would be do to... anyways, here is the code as it works right now without adding in a watermark:
if($submit) {
if(!empty($userfile)) {
$date = date("gismdY");
$rand = rand(1,20);
$complete = $date.$rand;
$type = split(".",$userfile_name,2);
$type2 = $type["1"];
copy($userfile, "/directory/$complete.$type2");
$db = mysql_connect("xxx", "xxx", "xxx");
mysql_select_db("robsgaming",$db);
mysql_query("INSERT INTO imgupload (filename,gameid,gametitle,system) VALUES ('$complete.$type2','$gameid','$gametitle','$system')");
$userfile = $userfile . "_thumb";
$tmpimg = tempnam("/directory/imgupload", "MKUP");
system("djpeg $userfile >$tmpimg");
system("pnmscale -xy 250 200 $tmpimg | cjpeg -smoo 10 -qual 50 >$userfile");
copy($userfile, "/directory/imgupload/$complete.$type2");
unlink($userfile);
echo("$complete.$type2 file uploaded");
}
}
heh, now where do i start? i'm using GLIB i'm prety sure on the server.. any help is GREATLY appreciated. if you can get something working i will try to throw in a few bucks to you if you like.