Reply to Problem uploading and resizing images

Problem uploading and resizing images new!
by Denzil, 16 years, 8 months ago
Hi

I am having problems resizing images. I am using WAMP 5, with PHP ver 5.2.5 and have enabled gd support.

GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled


My form is as follows and calls the image_uploader.php script:
<form enctype="multipart/form-data" action="image_uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="8000000" />
File: <input name="uploadedfile" type="file" size="50"/><br />
<input type="submit" value="Upload File" />
</form>


image_uploader.php script:
include('class.upload.php');
$handle = new upload($_FILES['uploadedfile']);
if ($handle->uploaded) {
   $handle->file_new_name_body   = 'image_resized';
   $handle->image_x              = 100;
   $handle->image_ratio_y        = true;
   $handle->image_resize         = true;
   $handle->Process('/wamp/www/test/');

   if ($handle->processed) {
      echo 'image resized';
      $handle->clean();
   } else {
      echo 'error : ' . $handle->error;
      }
  }

When I remove the $handle->image_resize = true; line from the above code the image file is uploaded to the destination directory above with the original dimensions. However, when image_resize is set to true as above, the image file is not uploaded at all.

Any ideas...? Thanks very muchReply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important