Yaz Hobooti
commited on
Commit
·
e482b0b
1
Parent(s):
ee41863
Fix indentation error: correct if-else block alignment in barcode detection
Browse files- Fixed IndentationError at line 677 in pdf_comparator.py
- Corrected indentation of else block to properly align with if statement
- Fixed Box constructor indentation to match surrounding code structure
- Resolves unindent does not match any outer indentation level error
- pdf_comparator.py +2 -2
pdf_comparator.py
CHANGED
|
@@ -386,7 +386,7 @@ def load_pdf_pages(path: str, dpi: int = 400, max_pages: int = 5) -> List[Image.
|
|
| 386 |
continue
|
| 387 |
|
| 388 |
return [img.convert("RGB") for img in imgs]
|
| 389 |
-
|
| 390 |
if poppler_path is None: # All pdf2image attempts failed
|
| 391 |
break
|
| 392 |
continue # Try next path
|
|
@@ -405,7 +405,7 @@ def load_pdf_pages(path: str, dpi: int = 400, max_pages: int = 5) -> List[Image.
|
|
| 405 |
pages.append(img.convert("RGB"))
|
| 406 |
doc.close()
|
| 407 |
return pages
|
| 408 |
-
|
| 409 |
raise ValueError(f"Failed to convert PDF with both pdf2image and PyMuPDF. pdf2image error: poppler not found. PyMuPDF error: {str(e)}")
|
| 410 |
else:
|
| 411 |
raise ValueError(f"Failed to convert PDF to image with all poppler paths. Last error: poppler not found. PyMuPDF not available as fallback.")
|
|
|
|
| 386 |
continue
|
| 387 |
|
| 388 |
return [img.convert("RGB") for img in imgs]
|
| 389 |
+
except Exception as e:
|
| 390 |
if poppler_path is None: # All pdf2image attempts failed
|
| 391 |
break
|
| 392 |
continue # Try next path
|
|
|
|
| 405 |
pages.append(img.convert("RGB"))
|
| 406 |
doc.close()
|
| 407 |
return pages
|
| 408 |
+
except Exception as e:
|
| 409 |
raise ValueError(f"Failed to convert PDF with both pdf2image and PyMuPDF. pdf2image error: poppler not found. PyMuPDF error: {str(e)}")
|
| 410 |
else:
|
| 411 |
raise ValueError(f"Failed to convert PDF to image with all poppler paths. Last error: poppler not found. PyMuPDF not available as fallback.")
|