Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Report hscommon\gui\progress_window.py #630

Closed
bdworking opened this issue Mar 22, 2020 · 8 comments
Closed

Error Report hscommon\gui\progress_window.py #630

bdworking opened this issue Mar 22, 2020 · 8 comments

Comments

@bdworking
Copy link

Error Report from crash.

Debug Log

Application Name: dupeGuru
Version: 4.0.4 RC
Windows

Traceback (most recent call last):
File "hscommon\gui\progress_window.py", line 101, in pulse
File "core\app.py", line 323, in _job_error
File "hscommon\jobprogress\performer.py", line 43, in _async_run
File "core\app.py", line 780, in do
File "core\scanner.py", line 137, in get_dupe_groups
File "core\pe\scanner.py", line 31, in _getmatches
File "core\pe\matchblock.py", line 167, in getmatches
File "core\pe\matchblock.py", line 83, in prepare_pictures
File "core\pe\photo.py", line 105, in get_blocks
File "qt\pe\photo.py", line 36, in _plat_get_blocks
TypeError: '<=' not supported between instances of 'int' and 'str'

@JensDA
Copy link

JensDA commented Aug 5, 2020

I've got a similar failure on Linux while scanning in picture mode with Match pictures of different dimensions enabled and a filter hardness of 93.

Application Name: dupeGuru
Version: 4.0.4 RC

Traceback (most recent call last):
  File "/usr/share/dupeguru/hscommon/gui/progress_window.py", line 101, in pulse
    should_continue = self._error_func(self.jobid, err)
  File "/usr/share/dupeguru/core/app.py", line 323, in _job_error
    raise err
  File "/usr/share/dupeguru/hscommon/jobprogress/performer.py", line 43, in _async_run
    target(*args)
  File "/usr/share/dupeguru/core/app.py", line 780, in do
    self.results.groups = scanner.get_dupe_groups(files, self.ignore_list, j)
  File "/usr/share/dupeguru/core/scanner.py", line 137, in get_dupe_groups
    matches = self._getmatches(files, j)
  File "/usr/share/dupeguru/core/pe/scanner.py", line 26, in _getmatches
    return matchblock.getmatches(
  File "/usr/share/dupeguru/core/pe/matchblock.py", line 167, in getmatches
    pictures = prepare_pictures(pictures, cache_path, with_dimensions=not match_scaled, j=j)
  File "/usr/share/dupeguru/core/pe/matchblock.py", line 83, in prepare_pictures
    blocks = picture.get_blocks(BLOCK_COUNT_PER_SIDE)
  File "/usr/share/dupeguru/core/pe/photo.py", line 105, in get_blocks
    return self._plat_get_blocks(block_count_per_side, self._get_orientation())
  File "/usr/share/dupeguru/qt/pe/photo.py", line 36, in _plat_get_blocks
    if 2 <= orientation <= 8:
TypeError: '<=' not supported between instances of 'int' and 'str'

@bdworking
Copy link
Author

I was moving files and a folder while dupguru was processing those files/folder.
Suspect the code is not paranoid enough and does not handle small failures gracefully.

@glubsy
Copy link
Contributor

glubsy commented Aug 5, 2020

If you can reproduce the bug, please enable logging in the Preferences and post the log here.

This has something to do with EXIF data. The error probably comes from core/pe/exif.py (in get_fields() or more specifically in dump_IFD())or core/pe/photo.py.

glubsy added a commit to glubsy/dupeguru that referenced this issue Aug 5, 2020
* In some cases, the function dump_IFD() in core/pe/exif.py assigns a string instead of an int as "values".
* This value is then used as _cached_orientation in core/pe/photo.py in _get_orientation().
* The method _plat_get_blocks() in qt/pe/photo.py was only expecting an integer for the orientation argument, so we work around the issue for now by ignoring the value if it's a string.
@JensDA
Copy link

JensDA commented Aug 6, 2020

On reproduction, debug log showed this:

2020-08-06 03:17:18,236 - DEBUG - Exif header length: 15952 bytes
2020-08-06 03:17:18,237 - DEBUG - Motorola format
2020-08-06 03:17:18,237 - DEBUG - IFD at offset 8
2020-08-06 03:17:18,237 - DEBUG - Entries for IFD 8: 12
2020-08-06 03:17:18,238 - DEBUG - Exif SubIFD at offset 240:
2020-08-06 03:17:18,238 - DEBUG - Entries for IFD 240: 34
2020-08-06 03:17:18,242 - DEBUG - Exif Interoperability SubSubIFD at offset 13002:
2020-08-06 03:17:18,242 - DEBUG - Entries for IFD 13002: 1

@JensDA
Copy link

JensDA commented Aug 6, 2020

exiftool reports Orientation : Horizontal (normal)

@glubsy
Copy link
Contributor

glubsy commented Aug 6, 2020

Thanks for the report. I'm assuming this is a TIFF file. If you want to test it further you could run my workaround branch (in debug mode still) and see the exact output.
Or if you know which file is causing this and don't mind sharing it, I could run the test for you.

@JensDA
Copy link

JensDA commented Aug 6, 2020

I tested the workaround branch and can confirm that the failure no longer occurs:
WARNING - Orientation for file '/home/jens/test/test.jpg' was a str '1', not an int!

Unrelated, but is it normal for the scan in picture mode to take multiple minutes to scan a directory containing only 3 pictures using Sqlite cache mode?

@glubsy
Copy link
Contributor

glubsy commented Aug 6, 2020

Thank you very much for testing the patch and reporting the log. Looks like it might be safe to just cast the string to an int (hopefully).

Unrelated, but is it normal for the scan in picture mode to take multiple minutes to scan a directory containing only 3 pictures using Sqlite cache mode?

This is not normal, unless maybe the files are exceptionally huge? Not familiar with the code to be honest but this might warrant a separate issue report.

arsenetar added a commit that referenced this issue Aug 7, 2020
arsenetar added a commit that referenced this issue Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants