Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Remember me?... File upload and JPEG functions
[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 · ·