diff --git a/google_vision.module b/google_vision.module
index b5b4609..b365cc1 100644
--- a/google_vision.module
+++ b/google_vision.module
@@ -12,6 +12,9 @@ use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\File\FileSystemInterface;
+use Drupal\file\FileInterface;
+use Drupal\user\Entity\User;
 
 /**
  * Implements hook_entity_presave().
@@ -33,11 +36,13 @@ function google_vision_entity_presave(Drupal\Core\Entity\EntityInterface $entity
             // Take first referenced vocabulary.
             $vid = reset($field->getSettings()['handler_settings']['target_bundles']);
             google_vision_file_entity_add_labels($entity, $field, $vid);
+            //google_vision_file_entity_emotion_detection($entity);
           }
         }
       }
     }
   }
+  google_vision_user_picture_emotion_detection($entity);
 }
 
 /**
@@ -155,3 +160,30 @@ function google_vision_file_entity_add_labels($file, $field, $vid) {
     }
   }
 }
+
+/**
+ * Detects the emotion in the user picture.
+ */
+function google_vision_user_picture_emotion_detection($entity) {
+  //$field_definitions = \Drupal::entityManager()->getFieldDefinitions('user', 'user');
+  if ($entity->getEntityTypeId() == 'user') {
+    foreach (\Drupal::service('entity_field.manager')->getFieldDefinitions('user', 'user') as $key => $value) {
+      if ($value->getType() == 'image') {
+        if(!empty($entity->get($key)->target_id)) {
+          $file_uri = $entity->get($key)->entity->getFileUri();
+          $likelihood = array('POSSIBLE', 'UNLIKELY', 'VERY_UNLIKELY');
+          if ($filepath = \Drupal::service('file_system')->realpath($file_uri)) {
+            $data = \Drupal::service('google_vision.api')->faceDetection($filepath);
+            // If we have retrieved the required emotion.
+            if (!empty($data['responses'][0]['faceAnnotations'])) {
+              $joy = $data['responses'][0]['faceAnnotations'][0]['joyLikelihood'];
+              if (in_array($joy, $likelihood)) {
+                drupal_set_message('You seem to be unhappy', 'warning');
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
