def to_degrees(dir, value):
    """
    convert the GPS coordinates stored in the EXIF to degress in float format
    :param value: tuples of DMS
    :param dir: direction E/N/W/S

    """
    d = float(value[0][0]) / float(value[0][1])
    m = float(value[1][0]) / float(value[1][1])
    s = float(value[2][0]) / float(value[2][1])
    w = 1 if dir in ('E', 'N') else -1
    return w * (d + (m / 60.0) + (s / 3600.0))