'Decode image data sent with the request.
Arguments:
face_data (str): base64-encoded face image data.
Keyword Arguments:
photo_id_data (str): base64-encoded photo ID image data.
Returns:
tuple of (str, str, HttpResponse)'

def _decode_image_data(self, face_data, photo_id_data=None):

    try:
        face_image = decode_image_data(face_data)
        photo_id_image = (decode_image_data(photo_id_data) if (photo_id_data is not None) else None)
        return (face_image, photo_id_image, None)
    except InvalidImageData:
        msg = _('Image    data    is    not    valid.')
        return (None, None, HttpResponseBadRequest(msg))
