Formatted everything with black
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from exif import Image
|
||||
|
||||
|
||||
def decimal_coords(coords: float, ref: str) -> float:
|
||||
"""Get latitude/longitude from coord and direction reference
|
||||
|
||||
@@ -9,12 +10,13 @@ def decimal_coords(coords: float, ref: str) -> float:
|
||||
|
||||
### Returns:
|
||||
* float: Decimal degrees
|
||||
"""
|
||||
"""
|
||||
decimal_degrees = coords[0] + coords[1] / 60 + coords[2] / 3600
|
||||
if ref == "S" or ref == "W":
|
||||
decimal_degrees = -decimal_degrees
|
||||
return round(decimal_degrees, 5)
|
||||
|
||||
|
||||
def extract_location(filepath: str) -> dict:
|
||||
"""Get location data from image
|
||||
|
||||
@@ -23,15 +25,11 @@ def extract_location(filepath: str) -> dict:
|
||||
|
||||
### Returns:
|
||||
* dict: `{ "lng": float, "lat": float, "alt": float }`
|
||||
"""
|
||||
"""
|
||||
|
||||
output = {
|
||||
"lng": 0.0,
|
||||
"lat": 0.0,
|
||||
"alt": 0.0
|
||||
}
|
||||
output = {"lng": 0.0, "lat": 0.0, "alt": 0.0}
|
||||
|
||||
with open(filepath, 'rb') as src:
|
||||
with open(filepath, "rb") as src:
|
||||
img = Image(src)
|
||||
|
||||
if img.has_exif is False:
|
||||
@@ -44,4 +42,4 @@ def extract_location(filepath: str) -> dict:
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
return output
|
||||
return output
|
||||
|
Reference in New Issue
Block a user