image/PDF_scanner #8
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces functionality for scanning media files, extracting text content using OCR, and managing file operations more robustly. It integrates three new/updated modules:
file_handler.py: Handles file input/output operations, validation, and error management.
ocr_engine.py: Provides OCR capabilities for extracting text from images and other supported formats.
scan_media.py: Implements the core logic for scanning media files, coordinating between file handling and OCR processing.
Key Changes
Implemented file handling utilities to safely load, save, and validate media files.
Added an OCR engine wrapper that abstracts text extraction and handles failures gracefully.
Built a media scanning pipeline that:
Improved error handling and logging for debugging and maintainability.
Modularised code to make each component reusable and testable.
Accepts image and other supported media types.
Uses ocr_engine to extract text content.
Provides structured results for downstream processing.