fixed argument types

This commit is contained in:
brian
2024-12-19 16:01:29 +00:00
parent c9da7378a1
commit 99d5c88c8d
4 changed files with 20 additions and 21 deletions
+1
View File
@@ -27,6 +27,7 @@ if __name__ == '__main__':
# get image from minio
buffer = get(
client=minio_client,
bucket_name=BUCKET_NAME,
object_name=obj.object_name,
)
# convert data to image
+8 -8
View File
@@ -3,16 +3,15 @@
from __future__ import annotations
import logging
from io import BytesIO
from pathlib import Path
from bson import ObjectId
from dotenv import load_dotenv
from pymongo.collection import Collection
from shared.datastore import connect_minio, put
from shared.datastore import connect_minio, put_image
from shared.mongodb import connect_mongodb
from shared.mongodb.classes import VisualCommunication
from shared.mongodb.src.classes import VisualCommunication
from shared.utils import check_env, setup_logging
from web_ui.src.main import NECESSARY_ENV_VAR_LIST
@@ -96,13 +95,14 @@ if __name__ == '__main__':
logging.error('failed getting image from document: %s', doc_id)
continue
try:
# save image to buffer
buffer = BytesIO()
vis_com.image.save(buffer, 'png') # type: ignore
# get image
image = vis_com.get_image(
minio_client=minio_client,
)
# put buffer in minio
object_name = put(
object_name = put_image(
client=minio_client,
buffer=buffer,
image=image,
)
except Exception as exc:
logging.debug(exc)