124 lines
2.9 KiB
Markdown
124 lines
2.9 KiB
Markdown
# Screenshot OCR Gallery
|
||
|
||
A Qt6-based image gallery application that allows you to search through OCR data from your screenshots with live preview.
|
||
|
||
## Features
|
||
|
||
- Fast visual navigation through your screenshot collection
|
||
- Live search through OCR text as you type
|
||
- 4×4 image gallery grid with 256px wide previews
|
||
- Opens images in your default image viewer on click
|
||
- Responsive design that adjusts to window size
|
||
- Proper error handling for missing files and database issues
|
||
|
||
## Requirements
|
||
|
||
### Build Dependencies
|
||
|
||
- Qt6 (Core, Gui, Widgets, Sql modules)
|
||
- C++17 compatible compiler
|
||
- CMake (3.16+)
|
||
- SQLite3 support
|
||
|
||
### For Arch Linux users:
|
||
```
|
||
sudo pacman -S qt6-base qt6-tools cmake
|
||
```
|
||
|
||
### For Debian/Ubuntu users:
|
||
```
|
||
sudo apt install qt6-base-dev libqt6sql6-sqlite cmake
|
||
```
|
||
|
||
## Database Requirements
|
||
|
||
The application expects a SQLite database file at `/home/master/screenshot_ocr.db` with the following schema:
|
||
|
||
```sql
|
||
CREATE TABLE ocr_results (
|
||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||
filename TEXT UNIQUE,
|
||
full_path TEXT,
|
||
ocr_text TEXT,
|
||
file_size INTEGER,
|
||
created_date TEXT,
|
||
ocr_date TEXT
|
||
);
|
||
```
|
||
|
||
## Building the Project
|
||
|
||
1. Clone or download this repository
|
||
2. Navigate to the project directory
|
||
3. Run the build script:
|
||
|
||
```bash
|
||
cd screenshot-gallery
|
||
chmod +x build.sh
|
||
./build.sh
|
||
```
|
||
|
||
The build script will:
|
||
- Check for required dependencies
|
||
- Create a build directory
|
||
- Run CMake to configure the project
|
||
- Build the executable
|
||
- Ask if you want to run the application
|
||
|
||
## Manual Build
|
||
|
||
If you prefer to build manually:
|
||
|
||
```bash
|
||
mkdir -p build
|
||
cd build
|
||
cmake ..
|
||
make
|
||
```
|
||
|
||
## Running the Application
|
||
|
||
After building, run the application:
|
||
|
||
```bash
|
||
./build/screenshot-gallery
|
||
```
|
||
|
||
## Usage
|
||
|
||
1. When the application starts, it will display all screenshots found in the database
|
||
2. Type in the search bar to filter images by OCR text content
|
||
3. Results update as you type
|
||
4. Click on any image to open it in your default image viewer
|
||
5. Hover over an image to see the file path and a preview of its OCR text
|
||
|
||
## Troubleshooting
|
||
|
||
### Database Connection Issues
|
||
|
||
If the application cannot connect to the database:
|
||
- Ensure the database file exists at the expected location (`/home/master/screenshot_ocr.db`)
|
||
- Check file permissions
|
||
- Verify the database has the required schema
|
||
|
||
### Missing Images
|
||
|
||
If the gallery shows placeholders instead of images:
|
||
- Verify that the image files exist at the paths stored in the database
|
||
- Check file permissions
|
||
- Ensure the paths in the database are correct and accessible
|
||
|
||
### Build Issues
|
||
|
||
If the build fails:
|
||
- Make sure you have installed all required Qt6 packages
|
||
- Check that your CMake version is at least 3.16
|
||
- Ensure you have the necessary permissions in the build directory
|
||
|
||
## License
|
||
|
||
This project is released under the MIT License.
|
||
|
||
## Contributing
|
||
|
||
Contributions are welcome! Feel free to submit pull requests or open issues for bugs and feature requests. |