Reply to Re: How to process multiple images that are inside a folder?

Re: How to process multiple images that are inside a folder? new!
by colin, 12 years, 6 months ago
You need to instantiate the class with a local image file, not a directory.

You first get all your file names in an array, and then loop through it, instantiating the class each time with each file name.
$files = array('pic1.jpg', 'pic2.jpg', 'pic3.jpg');
foreach ($files as $file) {
  $handle = new Upload($file);
  if ($handle->uploaded) {
    $handle->image_resize            = true;
    $handle->image_ratio_y           = true;
    $handle->image_x                 = 100;
    $handle->Process('destination_directory/');
  }
}
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