Skip to content

Commit

Permalink
Merge pull request #1013 from sickelap/update_sitesettings_validation
Browse files Browse the repository at this point in the history
allow to pass map_api_provider value to settings
  • Loading branch information
derneuere committed Sep 10, 2023
2 parents 0e1471c + 7d820dd commit 0793ade
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions api/models/photo.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,14 +627,17 @@ def _extract_faces(self, second_try=False):
image = np.array(PIL.Image.open(self.thumbnail_big.path))
area = region.get("Area")
applied_to_dimensions = region.get("AppliedToDimensions")
if (area and area.get("Unit") == "normalized") or (applied_to_dimensions and applied_to_dimensions.get("Unit") == "pixel"):
if (area and area.get("Unit") == "normalized") or (
applied_to_dimensions
and applied_to_dimensions.get("Unit") == "pixel"
):
# To-Do: Not sure, when to use this instead of the thumbnail size tbh
#if applied_to_dimensions:
# if applied_to_dimensions:
# image_width = applied_to_dimensions.get("W")
# image_height = applied_to_dimensions.get("H")

# To-Do: Rotation, this is already handled by thumbnail creation?!
#if region.get("Rotation"):
# if region.get("Rotation"):
# rotation = region.get("Rotation")
# if rotation == 90:
# image = np.rot90(image, 1)
Expand Down
2 changes: 1 addition & 1 deletion api/schemas/site_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{"required": ["allow_upload"]},
{"required": ["skip_patterns"]},
{"required": ["heavyweight_process"]},
# {"required": ["map_api_provider"]},
{"required": ["map_api_provider"]},
{"required": ["map_api_key"]},
],
"properties": {
Expand Down

0 comments on commit 0793ade

Please sign in to comment.