Skip to content

vinayakkamatcodes/ocrify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

<<<<<<< HEAD

image_to_text

=======

OCRify - Cross-Platform OCR Application

A fully functional, cross-platform Flutter application for Optical Character Recognition (OCR) on images. OCRify supports Windows, macOS, Linux (Desktop), Android & iOS (Mobile), and Web (Browser).

✨ Features

  • Cross-Platform Support: Works on Windows, macOS, Linux, Android, iOS, and Web
  • Image Upload/Selection: Pick images from device or upload files with preview
  • OCR Functionality:
    • Desktop: Uses native Tesseract installation for high-performance OCR
    • Mobile: Optimized for mobile devices with platform-specific implementations
    • Web: Browser-based OCR processing (placeholder for Tesseract.js integration)
  • Modern UI/UX: Material 3 design with adaptive layout for different screen sizes
  • Three Main Tabs:
    • Select Image: Upload and preview images for OCR processing
    • Extracted Text: View OCR results with copy to clipboard functionality
    • History: Track all OCR operations with success/failure status
  • Local Storage: Hive-based local storage for OCR history and results
  • Error Handling: Graceful handling of unsupported formats and processing failures
  • Progress Tracking: Real-time progress updates during OCR processing

πŸš€ Prerequisites

Required

  • Flutter 3.9.0+ and Dart 3.9.0+
  • Git for cloning the repository

Desktop OCR (Optional)

  • Tesseract OCR installed and available in PATH
    • Windows: Download from UB-Mannheim
    • macOS: brew install tesseract
    • Linux: sudo apt install tesseract-ocr

πŸ“¦ Installation

  1. Clone the repository

    git clone <repository-url>
    cd ocrify
  2. Install Flutter dependencies

    flutter pub get
  3. Generate Hive adapters (for local storage)

    flutter packages pub run build_runner build

πŸ—οΈ Building and Running

Development Mode

# Run on Linux
flutter run -d linux

# Run on Windows
flutter run -d windows

# Run on macOS
flutter run -d macos

# Run on Android
flutter run -d android

# Run on iOS
flutter run -d ios

# Run on Web
flutter run -d chrome

Production Builds

# Build for Linux
flutter build linux --release

# Build for Windows
flutter build windows --release

# Build for macOS
flutter build macos --release

# Build for Android
flutter build apk --release

# Build for iOS
flutter build ios --release

# Build for Web
flutter build web --release

πŸ—οΈ Project Structure

ocrify/
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   └── app.dart                 # Main application widget
β”‚   β”œβ”€β”€ features/
β”‚   β”‚   └── ocr/
β”‚   β”‚       β”œβ”€β”€ domain/
β”‚   β”‚       β”‚   └── services/
β”‚   β”‚       β”‚       └── ocr_service.dart  # OCR service interface & implementations
β”‚   β”‚       └── presentation/
β”‚   β”‚           β”œβ”€β”€ pages/
β”‚   β”‚           β”‚   └── home_page.dart     # Main home page with tabs
β”‚   β”‚           β”œβ”€β”€ providers/
β”‚   β”‚           β”‚   β”œβ”€β”€ image_provider.dart    # Image selection state
β”‚   β”‚           β”‚   β”œβ”€β”€ ocr_provider.dart      # OCR processing state
β”‚   β”‚           β”‚   └── history_provider.dart  # History management state
β”‚   β”‚           └── widgets/
β”‚   β”‚               β”œβ”€β”€ image_selection_tab.dart  # Image upload/selection tab
β”‚   β”‚               β”œβ”€β”€ ocr_results_tab.dart      # OCR results display tab
β”‚   β”‚               └── history_tab.dart          # History management tab
β”‚   └── shared/
β”‚       β”œβ”€β”€ models/
β”‚       β”‚   β”œβ”€β”€ ocr_result.dart          # OCR result data model
β”‚       β”‚   └── ocr_history_item.dart    # History item data model
β”‚       β”œβ”€β”€ services/
β”‚       └── utils/
β”‚           └── platform_utils.dart      # Platform detection utilities
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ images/                        # Image assets
β”‚   └── js/                           # JavaScript files for web
β”œβ”€β”€ test/                             # Unit and widget tests
└── pubspec.yaml                      # Dependencies and configuration

πŸ”§ Configuration

Environment Variables

  • No environment variables required for basic functionality
  • Tesseract path detection is automatic on desktop platforms

Platform-Specific Settings

  • Android: Permissions configured in android/app/src/main/AndroidManifest.xml
  • iOS: Privacy descriptions in ios/Runner/Info.plist
  • Web: PWA configuration in web/manifest.json
  • Desktop: Native Tesseract integration

πŸ“± Usage Guide

Basic OCR Process

  1. Select Image: Use the "Select Image" tab to choose an image file
  2. Start OCR: Click "Start OCR" to begin text extraction
  3. Automatic Navigation: The app automatically switches to the "Extracted Text" tab when processing is complete
  4. View Results: See the extracted text with processing details and metadata
  5. Copy Text: Use the copy button to copy extracted text to clipboard
  6. Check History: View processing history in the "History" tab

User Experience Features

  • Automatic Tab Switching: After OCR completion, users are automatically taken to the results tab
  • Smooth Animations: Smooth transitions between tabs and animated success indicators
  • Progress Tracking: Real-time progress updates during OCR processing
  • Smart Navigation: Prevents unnecessary tab switches and respects user manual navigation

Supported Image Formats

  • JPEG/JPG
  • PNG
  • BMP
  • TIFF
  • WebP

OCR Settings

  • Desktop: Uses Tesseract with PSM 6 (uniform block of text) and OEM 3 (default engine)
  • Mobile: Platform-optimized settings
  • Web: Browser-based processing (placeholder)

πŸ§ͺ Testing

Run Tests

# Unit tests
flutter test

# Specific test file
flutter test test/ocr_service_test.dart

# With coverage
flutter test --coverage

Test Coverage

  • Data models: 100% coverage
  • OCR services: Platform-specific implementations
  • UI components: Widget testing
  • State management: Provider testing

πŸ› Troubleshooting

Common Issues

Tesseract Not Found (Desktop)

Error: Tesseract is not installed. Please install Tesseract from https://github.com/tesseract-ocr/tesseract

Solution: Install Tesseract OCR for your platform and ensure it's in PATH

Build Failures

  • Linux: Ensure required development packages are installed
  • Windows: Check Visual Studio build tools
  • macOS: Verify Xcode command line tools

Plugin Warnings

  • File picker warnings are informational and don't affect functionality
  • These are known issues with the file_picker plugin

Performance Tips

  • Desktop: Use high-quality images for better OCR accuracy
  • Mobile: Optimize image size before processing
  • Web: Consider image compression for faster uploads

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow Flutter best practices
  • Use Riverpod for state management
  • Maintain test coverage above 80%
  • Add comprehensive documentation
  • Follow Material 3 design principles

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Tesseract OCR: Open-source OCR engine
  • Flutter Team: Cross-platform framework
  • Riverpod: State management solution
  • Hive: Local storage solution

πŸ“ž Support

  • Issues: Report bugs and feature requests via GitHub Issues
  • Discussions: Join community discussions
  • Documentation: Check the wiki for detailed guides

πŸ“‹ Changelog

Version 1.0.0

  • Initial release
  • Cross-platform OCR functionality
  • Material 3 UI design
  • Local storage with Hive
  • Riverpod state management
  • Comprehensive testing suite

OCRify - Making text extraction simple across all platforms! πŸš€

6b2d53f (Initial commit: OCRify v1.0.0 - Cross-platform OCR application with Google ML Kit integration)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published