создание, правка, удаление, скрытие инструмента
This commit is contained in:
Binary file not shown.
+5
-5
@@ -32,7 +32,7 @@ def saveImage(file_bytes: bytes, file_name: str) -> bool:
|
||||
if not target_path.lower().endswith(".png"):
|
||||
target_path += ".png"
|
||||
|
||||
logger.info(f"[ImageSave] Saving image to {target_path}")
|
||||
logger.debug(f"[ImageSave] Saving image to {target_path}")
|
||||
img.save(target_path, "PNG")
|
||||
return True
|
||||
|
||||
@@ -47,10 +47,10 @@ def deleteImage(fileName: str):
|
||||
try:
|
||||
import os
|
||||
|
||||
file_name = f"api/{file_name}"
|
||||
logger.info(f"Удаляем изображение {fileName}")
|
||||
os.remove(f"static/images/{fileName}")
|
||||
logger.info(f"Изображение {fileName} успешно удалено")
|
||||
fileName = f"api/{fileName}"
|
||||
logger.debug(f"Удаляем изображение {fileName}")
|
||||
os.remove(fileName)
|
||||
logger.debug(f"Изображение {fileName} успешно удалено")
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.error(f"Ошибка удаления изображения: {str(e)}")
|
||||
|
||||
Reference in New Issue
Block a user