I'm trying to find a way to automatically update the CiviCRM contact image when a user updates their Drupal profile image. I'm specifically looking for Drupal8.5/Civi4.7 but I'll take anything that can properly update Civi4.7 at this point, regardless of Drupal version. It seems that the Drupal/Civi API functions are almost, but not quite, capable of making this easy, although it may just be a documentation deficiency -- I'm still digging in the code.
I found this discussion on the old Civi forum (circa 2011) which discusses it. https://forum.civicrm.org/index.php%3Ftopic=22405.0.html
There is also some old code in the Civi site which directly updates the database and also doesn't seem to work anymore: https://wiki.civicrm.org/confluence/display/CRMDOC/Adding+pictures+in+civicrm+profile+page
Is there anything as of Civi 4.7.30 which can do this?
If not, can someone point me to some docs/examples that demonstrate how to programmatically add a photo image to a contact in Civi?