elisemercury / Duplicate-Image-Finder

difPy - Python package for finding duplicate and similar images
https://difpy.readthedocs.io
MIT License
465 stars 67 forks source link

Launching dif.py with the parameters below causes it to terminate #75

Closed audiomuze closed 1 year ago

audiomuze commented 1 year ago
$ python dif.py --directory /qnap/qnap2/zzl/ --output_directory /tmp --recursive True --limit_extensions True --show_progress True

Gave rise to:

Traceback (most recent call last):
  File "/home/x/git/Duplicate-Image-Finder/difPy/dif.py", line 633, in <module>
    dif = build(args.directory, recursive=args.recursive, in_folder=args.in_folder, limit_extensions=args.limit_extensions,px_size=args.px_size, show_progress=args.show_progress, logs=args.logs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/x/git/Duplicate-Image-Finder/difPy/dif.py", line 52, in __init__
    self._tensor_dictionary, self._filename_dictionary, self._id_to_group_dictionary, self._group_to_id_dictionary, self._invalid_files, self._stats = self._main()
                                                                                                                                                       ^^^^^^^^^^^^
  File "/home/x/git/Duplicate-Image-Finder/difPy/dif.py", line 62, in _main
    valid_files, skipped_files = self._get_files()
                                 ^^^^^^^^^^^^^^^^^
  File "/home/x/git/Duplicate-Image-Finder/difPy/dif.py", line 125, in _get_files
    valid_files, skip_files = self._validate_files(files)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/x/git/Duplicate-Image-Finder/difPy/dif.py", line 135, in _validate_files
    valid_files, skip_files = self._filter_extensions(valid_files)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/x/git/Duplicate-Image-Finder/difPy/dif.py", line 143, in _filter_extensions
    extensions = [file.split(".")[1].lower() for file in directory_files]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/x/git/Duplicate-Image-Finder/difPy/dif.py", line 143, in <listcomp>
    extensions = [file.split(".")[1].lower() for file in directory_files]
                  ~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
elisemercury commented 1 year ago

Hi @audiomuze,

Thanks a lot for flagging this! I haven't encountered this issue so far. Handling of this error will be added in the next update of difPy.

Thanks again and best, Elise

elisemercury commented 1 year ago

Hi @audiomuze,

This issue has been fixed with difPy v4.0.1. Thanks again for flagging this!

Best, Elise