def get_library_version():
    """ Get the version number of the underlying gphoto2 library.

    :return: The version
    :rtype:  tuple of (major, minor, patch) version numbers
    """
    version_str = ffi.string(lib.gp_library_version(True)[0]).decode()
    return tuple(int(x) for x in version_str.split('.'))