Reply to Image Resize Issue

Image Resize Issue new!
by Matto, 13 years, 3 months ago
Hi,
I can run the scrip and it save the image - only it isn't resizing them ;(

This is what I have so far
include('class.upload.php');
$handle->mime_fileinfo = false;
$foo = new Upload($_FILES['image']);
$handle->mime_fileinfo = false;
if ($foo->uploaded) {
  // save uploaded image with no changes
  $foo->Process('../images/products/test/');
  if ($foo->processed) {
    echo 'original image copied';
  } else {
    echo 'error : ' . $foo->error;
  }
  // save uploaded image with a new name
  $foo->file_new_name_body = $seo_name;
  $foo->Process('../images/products/l/');
  if ($foo->processed) {
    echo 'image copied ';
  } else {
    echo 'error : ' . $foo->error;
  }
  echo '
';
  // save uploaded image with a new name,
  // resized to 100px wide
  $handle->mime_fileinfo = false;
  $foo->file_new_name_body = $seo_name;
  $handle->file_overwrite = true;
  $foo->image_resize          = true;
  $foo->image_ratio_fill      = 'R';
  $$foo->image_ratio_y         = true;
  $foo->image_x               = 295;
  $foo->Process('../images/products/m/');
  if ($foo->processed) {
    echo 'image renamed, resized x=295 ';
  } else {
    echo 'error : ' . $foo->error;
  }
  echo '
';
  // save uploaded image with a new name,
  // resized to 100px wide
  $handle->mime_fileinfo = false;
  $foo->file_new_name_body = $seo_name;
  $handle->file_overwrite = true;
  $foo->image_resize          = true;
  $foo->image_ratio_fill      = 'R';
  $foo->image_y               = 145;
  $foo->image_x               = 115;
  $foo->image_convert         = 'jpg';
  $foo->jpeg_quality          = 80;
  $foo->Process('../images/products/s/');
  if ($foo->processed) {
    echo 'image renamed, resized x=115 and y=145 ';
    $foo->Clean();
  } else {
    echo 'error : ' . $foo->error;
  }
}
Reply

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