From 2e6c955be321cefd7e0c4a3031eab805e0a5a303 Mon Sep 17 00:00:00 2001
From: Bin <bin.zheng@slooong.com>
Date: 星期三, 17 十二月 2025 12:00:39 +0800
Subject: [PATCH] 解决图片导出问题
---
label_studio/data_import/models.py | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/label_studio/data_import/models.py b/label_studio/data_import/models.py
index 016ada7..ee40539 100644
--- a/label_studio/data_import/models.py
+++ b/label_studio/data_import/models.py
@@ -238,11 +238,10 @@
def read_task_from_uploaded_file(self):
logger.debug('Read 1 task from uploaded file {}'.format(self.filepath))
- # 使用相对路径而不是URL,这样:
- # 1. 不会暴露完整的系统路径
- # 2. Converter 能够正确解析路径(相对于 MEDIA_ROOT/UPLOAD_DIR)
- # 例如:'upload/1/xxx.png' 而不是 '/data/upload/1/xxx.png'
- tasks = [{'data': {settings.DATA_UNDEFINED_NAME: self.filepath}}]
+ if settings.CLOUD_FILE_STORAGE_ENABLED:
+ tasks = [{'data': {settings.DATA_UNDEFINED_NAME: self.filepath}}]
+ else:
+ tasks = [{'data': {settings.DATA_UNDEFINED_NAME: self.url}}]
return tasks
@property
--
Gitblit v1.9.3