Fix issue when searching for image with relative path. Fixes #1925

This commit is contained in:
grossmj 2021-08-25 17:23:21 +09:30
parent 27bcb60580
commit 6005e89181

View File

@ -544,8 +544,7 @@ class BaseManager:
s = os.path.split(searched_file) s = os.path.split(searched_file)
for root, dirs, files in os.walk(directory): for root, dirs, files in os.walk(directory):
for file in files: for file in files:
# If filename is the same if s[1] == file and (s[0] == '' or root == os.path.join(directory, s[0])):
if s[1] == file and (s[0] == '' or os.path.basename(s[0]) == os.path.basename(root)):
path = os.path.normpath(os.path.join(root, s[1])) path = os.path.normpath(os.path.join(root, s[1]))
if os.path.exists(path): if os.path.exists(path):
return path return path