Skip to content

Commit 1bc4962

Browse files
committed
Remove whitespace from tags when loading directory
1 parent 60fd9b5 commit 1bc4962

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

taggui/models/image_list_model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ def load_directory(self, directory_path: Path):
7979
caption = text_file_path.read_text()
8080
if caption:
8181
tags = caption.split(self.separator)
82+
tags = [tag.strip() for tag in tags]
83+
tags = [tag for tag in tags if tag]
8284
image = Image(image_path, dimensions, tags)
8385
self.images.append(image)
8486
self.images.sort(key=lambda image_: image_.path)

0 commit comments

Comments
 (0)