If you are using intervention in laravel for image resize then below snippet you can use to resize with max width and max height and maintaing aspect ration.
$img = Image::make($file);
$new_filename = 'newname.'.$file->getClientOriginalExtension();
$img->widen(660, function($constraint){
$constraint->upsize(); //this makes sure no upsize
})->heighten(330, function($constraint){
$constraint->upsize(); //this constraint makes sure no upsize
});
$img->save(public_path().'/uploads/post/' . $new_filename);