[code]function ImgUpload($title, $handle)
// Uh... This opens the file and counts the rows
$path = 'img/'. $handle .'_'. $title .'.jpg';
$thumb = 'img/'. $handle .'_'. $title .'_thumb.jpg';
// Move uploaded file
// Stuff for creating the thumbnail...
$imagecreated = ImageCreateFromJPEG($path);
// Set the values for some image croppage:
$arrayage = getimagesize($path);
$w = 40;
$h = 110;
$x = rand(1, $arrayage - $w);
$y = rand(1, $arrayage - $h);
// Create the temporary image file
$thumbImgResized = Imagecreatetruecolor($w, $h);
$originalimage = imagecreatefromjpeg($path);
imagecopyresized($thumbImgResized, $originalimage, 0, 0, $x, $y, $w, $h, $w, $h);
Now that I've got that out, I'll tell you about it. ^^
It's an image uploading script for my site, but it's more than that! It also makes a jpeg of a random section of the picture.
That is, it would, if it ever got past the move_uploaded_file() function. For some reason, I always get an error that it can't do anything with the file, because it was never uploaded. In fact, I use my FTP program to see that it has indeed never been uploaded. I don't know why this isn't working, because everything seems in order to me.
0 · ·