修复路径引号处理:正确去除带引号的图片路径中的引号
This commit is contained in:
@@ -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
|
||||
|
||||
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 |
Reference in New Issue
Block a user