Resize based on both height and width

See all posts Reply

Resize based on both height and width new!
by Mack, 14 years, 9 months ago
I would like to resize a thumbnail by width then height, do I need to process it twice?Reply
Re: Resize based on both height and width new!
by Mack, 14 years, 9 months ago
Oops, sorry my code was wrong.

this worked..
$handle = new upload($_FILES['image']);
if ($handle->uploaded) {
  $handle->file_new_name_body   = $_POST['image'];
  $handle->image_resize         = true;
  $handle->image_x              = MIMAGETHUMBSIZE;
  $handle->image_y                            = 150;
  $handle->image_ratio_y        = true;
  $handle->image_ratio_x              = true;
  $handle->image_convert = 'png';
  $handle->process(MIMAGETHUMBPATH);

  $handle->file_new_name_body   = $_POST['image'];
  $handle->image_resize         = true;
  $handle->image_x              = MIMAGESIZE;
  $handle->image_ratio_y        = true;
  $handle->image_convert = 'png';
  $handle->process(MIMAGEPATH);

  if ($handle->processed) {
    $handle->clean();
  }
}
Reply