REFINE 修正输出文件夹路径检查逻辑,确保保存图像时不在输出文件夹外
This commit is contained in:
parent
a3d113b8a8
commit
467c8b2549
|
|
@ -177,7 +177,7 @@ class SaveImageWithOutput:
|
|||
subfolder = ""
|
||||
full_output_folder = os.path.join(output_dir, subfolder)
|
||||
|
||||
if os.path.commonpath((output_dir, os.path.abspath(full_output_folder))) != output_dir:
|
||||
if os.path.commonpath((os.path.abspath(output_dir), os.path.abspath(full_output_folder))) != os.path.abspath(output_dir):
|
||||
print("Saving image outside the output folder is not allowed.")
|
||||
return {}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue