redhuntlabs / Octopii

An AI-powered Personal Identifiable Information (PII) scanner.
https://redhuntlabs.com/blog/octopii-an-opensource-pii-scanner-for-images.html
Other
643 stars 54 forks source link

UnboundLocalError: local variable 'contains_faces' referenced before assignment #12

Closed jonatas-lima closed 1 year ago

jonatas-lima commented 1 year ago

Describe the bug When running the tool on a directory without images or PDF files, an UnboundLocalError is raised because the variable contains_faces has not been initialized. I believe that adding contains_faces = 0 at the beginning of the search_pii(file_path) function will solve the issue.

To Reproduce Steps to reproduce the behavior:

  1. Create a directory dir only with text files
  2. Run python3 octopii.py dir/

Expected behavior Octopii runs successfully

owais-redhunt commented 1 year ago

Thanks. Fixed in #13 .