Skip to content

Commit

Permalink
Exclude .npz files when loading directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jhc13 committed Feb 20, 2024
1 parent ec3470d commit df23360
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion taggui/models/image_list_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from utils.utils import get_confirmation_dialog_reply

UNDO_STACK_SIZE = 32
NON_IMAGE_SUFFIXES = ['.json', '.jsonl', '.npz']


def get_file_paths(directory_path: Path) -> set[Path]:
Expand Down Expand Up @@ -98,7 +99,7 @@ def load_directory(self, directory_path: Path):
if path.suffix == '.txt'}
image_paths = file_paths - text_file_paths
image_paths = {path for path in image_paths
if path.suffix.lower() not in ('.json', '.jsonl')}
if path.suffix.lower() not in NON_IMAGE_SUFFIXES}
for image_path in image_paths:
try:
dimensions = imagesize.get(image_path)
Expand Down

0 comments on commit df23360

Please sign in to comment.