This will require an add-on that basically duplicates the upload avatar process, you should look at how XenForo uploads avatars. There's also 3 different sizes (s(mall), m(edium), and l(arge)) that need saved.