Reply to Multiple thumbnail sizes doesn't work

Multiple thumbnail sizes doesn't work new!
by Derek, 12 years, 4 months ago
We are trying to use the class to make multiple sized images of the original image. The first thumbnail size is generated fine, the medium size ends up being the same size as the original.

Also, the $medium_width and $medium_height that get returned are the same as the thumbnail

// Let's make some baby photos!
require_once(SUNSHINE_PATH.'/includes/class.upload.php');
$image = new Upload($upload_dir['basedir'].'/sunshine/'.$dir.'/'.$basename);
// Resize defaults
$image->image_resize = true;
$image->jpeg_quality = 100;
$image->auto_create_dir = true;
$image->dir_auto_chmod = true;
$image->image_ratio_y = true;
$image->file_overwrite = true;
// Make thumbnail
$image->image_x = 100;
$image->Process($upload_dir['basedir'].'/sunshine/'.$dir.'/thumbnail');
$thumb_result = $image->processed;
$thumb_width = $image->image_dst_x;
$thumb_height = $image->image_dst_y;
// Make medium
$image->image_x = 400;
$image->Process($upload_dir['basedir'].'/sunshine/'.$dir.'/medium');
$medium_result = $image->processed;
$medium_width = $image->image_dst_x;
$medium_height = $image->image_dst_y;
// If we were able to make thumbnail/medium, then let's add attachment to the database
if ($thumb_result && $medium_result) { 
  ...
} else {
  echo 'error : ' . $image->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