修复路径引号处理:正确去除带引号的图片路径中的引号

This commit is contained in:
ypshidifu
2026-09-18 21:37:18 +08:00
parent 816a8089a1
commit ed04d4148e
5 changed files with 4 additions and 2 deletions
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

+4 -2
View File
@@ -34,15 +34,17 @@ def print_stats():
def process_single(image_arg, text):
"""处理单张图片:可选格式转换/输出路径,添加平铺水印,计数+1。"""
# 去掉首尾引号
# 去掉首尾引号(兼容命令行传入带引号的路径)
image_arg = image_arg.strip().strip('"').strip("'")
text = text.strip().strip('"').strip("'")
output_spec = None
if ">" in image_arg:
parts = image_arg.rsplit(">", 1)
image_arg = parts[0].strip()
image_arg = parts[0].strip().strip('"').strip("'")
output_spec = parts[1].strip()
else:
image_arg = image_arg.strip().strip('"').strip("'")
# 验证输入路径
input_path = image_arg
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB