oad_dir_small2.$this->_filename);
}
@ImageDestroy ($im);
}
}
function save($createsmall = 0, $new_name = ''){
$this->_filename = $new_name;
if($createsmall){
$ret_create_small_image = $this->create_small_image();
}
$ret_move = $this->move();
if($ret_move != 1){
$this->message[] = 'The file could not be uploaded, the file could not be copied to destination directory';
return false;
}
}
function ResizeImage($im,$maxwidth,$maxheight = '',$name){
$width = @imagesx($im);
$height = @imagesy($im);
if($maxwidth && $width > $maxwidth){
$RESIZEWIDTH = false;
if($maxwidth && $width > $maxwidth){
$widthratio = $maxwidth/$width;
$RESIZEWIDTH = true;
}
if($RESIZEWIDTH){
$ratio = $widthratio;
}
$newwidth = $width * $ratio;
$newheight = $height * $ratio;
if(function_exists("imagecopyresampled")){
$newim = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
}else{
$newim = imagecreate($newwidth, $newheight);
imagecopyresized($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
}
ImageJpeg ($newim,$name . ".jpg");
ImageDestroy ($newim);
}else{
ImageJpeg ($im,$name . ".jpg");
}
}
}
?>