$result = Files::copyFile($file['tmp_name'], $path, $file['name']);//////////////////Start Image Resize Hack ///////////
/// for extended file manager by apollo13 9.2005
$maxwidth=$this->config['maxwidth'];
$maxheight=$this->config['maxheight'];
$quality= $this->config['quality'];
// check if vars are set
if ($maxwidth or $maxheight or $quality)
{
// get vars
require_once('Transform.php');
$img=Image_Transform::factory(IMAGE_CLASS);
$fullpath=$path.$result;
$img->load($fullpath);
$or_width=$img->img_x;
$or_height=$img->img_y;
if (!$quality)
{
$quality=100;
}
////////////////////////////////
// new sizes after maxwidth restriction
// prevent enlargement
if ($or_width<$maxwidth)
{
$maxwidth='';
}
// do the calculations
if ($maxwidth)
{
$sizechanged=true;
$new_height = round(($maxwidth / $or_width) * $or_height, 0);
$new_width = $maxwidth;
}
else
{
$new_width = $or_width;
$new_height = $or_height;
}
////////////////////////////////
// new sizes after maxheight restriction
// prevent enlargement
if ($new_height<$maxheight)
{
$maxheight='';
}
//do the calculations
if ($maxheight)
{
$sizechanged=true;
$final_width = round(($maxheight / $new_height) * $new_width, 0);
$final_height= $maxheight;
}
else
{
$final_width = $new_width;
$final_height = $new_height;
}
if ($sizechanged or $quality<100)
{
// start operations
$img->resize($final_width,$final_height);
$img->save($fullpath,'',$quality);
$img->free();
}
}
////////// END RESIZE HACK //////////////$IMConfig['maxwidth']=250;
$IMConfig['maxheight']=350;
$IMConfig['quality']=85;Template courtesy of Designs By Darren.