libimage-magick should be sufficient, however I don't know how well that runs on androids and iphones.
It smells like a NIH project to me, but then again there might have been some very special requirements that facebook needed that was not already available in other libraries.