Skip to content
Snippets Groups Projects
Commit 21b09c41 authored by Eirik Martin Danielsen's avatar Eirik Martin Danielsen :speech_balloon:
Browse files

Merge branch '34-rematch-function-and-endpoint' of...

Merge branch '34-rematch-function-and-endpoint' of https://git.gvk.idi.ntnu.no/HermanDyrkorn/salamander-api into 34-rematch-function-and-endpoint

merging
parents 303b6a97 1576f114
No related branches found
No related tags found
1 merge request!37Resolve "rematch function and endpoint"
......@@ -26,7 +26,8 @@ class SalamanderImageEndpoint(Resource):
path_to_salamander_images = os.path.join("./images", location.name, salamander.species, salamander.sex, str(salamander.id))
list_of_paths = glob.glob(os.path.join(path_to_salamander_images, '*.*'))
for path in list_of_paths:
if path.__contains__(str(image_id)):
basename = os.path.basename(path)
if basename.__contains__(str(image_id)):
encoded = encode(path)[2:-1]
image_data = {"url": "data:image/png;base64," + encoded}
salamander_images.append(image_data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment