fixed argument types
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user