• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
MRPRRSIDENT

MRPRRSIDENT

Jpegconversionfrtb

Convertion for frtb jpeg files
Public
Like
Jpegconversionfrtb
Home
Code
7
backend
1
frontend
3
untitled-folder-2697
1
README.md
main.ts
H
new-file-3657.ts
new-file-9836.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://MRPRRSIDENT--85a20ee2c92611f0b89f42dde27851f2.web.val.run
README.md

JPEG/HEIC to HTML OCR Converter

A robust web application that allows users to upload JPEG and HEIC images and convert them to HTML using advanced OCR (Optical Character Recognition) with mathematical formula preservation. Now with enhanced HEIC support and improved error handling.

Features

  • Enhanced HEIC Support: Robust handling of HEIC files with automatic conversion to JPEG
  • Drag and Drop Interface: Easy file upload with visual feedback for JPEG and HEIC formats
  • Multiple File Upload: Process up to 60 files simultaneously with batch processing
  • Advanced OCR: Text recognition using Tesseract.js with mathematical formula detection
  • Mathematical Formula Recognition: Specialized detection and preservation of mathematical expressions
  • LaTeX Math Rendering: Mathematical formulas preserved using MathJax in HTML output
  • Real-time Progress Tracking: Detailed progress monitoring for each file including conversion status
  • Error Recovery: Comprehensive error handling with detailed error messages
  • HTML Output Generation: Clean, styled HTML with mathematical notation properly rendered

Recent Improvements

HEIC Processing Enhancements

  • Improved Library Loading: Better handling of heic2any library initialization with immediate loading
  • Enhanced File Detection: More robust HEIC file format detection using both MIME types and file extensions
  • Higher Quality Conversion: Optimized JPEG conversion settings for better OCR accuracy
  • Better Error Handling: Detailed error messages for conversion failures
  • Progress Tracking: Real-time status updates during HEIC conversion process
  • Smart UI Feedback: Visual indicators prevent premature file uploads before libraries are ready

User Experience Improvements

  • Loading Status Indicators: Real-time visual feedback showing library loading progress
  • Smart Upload Area: Disabled upload area until all libraries are loaded
  • No Premature Warnings: Removed confusing warning messages during library loading
  • Animated Status Dots: Pulsing indicators show when libraries are still loading
  • Helpful Loading Messages: Clear guidance on when the system is ready for use

OCR Processing Improvements

  • Enhanced Character Recognition: Expanded character whitelist for better mathematical symbol detection
  • Improved Engine Configuration: Optimized Tesseract.js settings for mathematical content
  • Better Progress Reporting: More granular progress updates during OCR processing
  • Extended Library Waiting: Longer timeout periods for reliable library loading
  • Library Availability Checks: Robust checking for library availability before processing

HTML Output Enhancements

  • HEIC File Indicators: Clear badges showing which files were converted from HEIC
  • Enhanced Statistics: Detailed processing summary including conversion counts
  • Better Visual Design: Improved styling with file type indicators and processing notes
  • Conversion Tracking: Clear indication of which files underwent HEIC conversion

Project Structure

├── backend/
│   └── index.ts          # Enhanced API server with robust HEIF support and improved error handling
├── frontend/
│   ├── index.html        # Updated HTML template with improved library loading
│   ├── index.tsx         # Enhanced React application with better HEIF processing
│   └── style.css         # Custom styles with math formula styling
└── README.md

Advanced Features

Enhanced HEIC Support

  • Automatic Format Detection: Robust detection of HEIC files using both MIME types and file extensions
  • Improved Library Loading: Better handling of heic2any library with retry mechanisms
  • High-Quality Conversion: Optimized JPEG conversion settings (95% quality) for better OCR accuracy
  • Conversion Progress Tracking: Real-time status updates during HEIC to JPEG conversion
  • Error Recovery: Graceful handling of conversion failures with detailed error messages
  • Preview Generation: Automatic preview generation for HEIC files after conversion

Mathematical Formula Recognition

  • Enhanced Pattern Detection: Improved detection of mathematical expressions and symbols
  • Extended Symbol Support: Support for Greek letters, mathematical operators, and special symbols
  • LaTeX-Style Preservation: Mathematical formulas preserved in LaTeX format for HTML output
  • MathJax Integration: Proper mathematical display using MathJax rendering engine
  • Formula Counting: Automatic counting and display of detected mathematical formulas

Robust OCR Processing

  • Enhanced Tesseract Configuration: Optimized settings for mathematical content recognition
  • Extended Character Whitelist: Comprehensive character set including mathematical symbols
  • Progress Monitoring: Detailed progress tracking with percentage completion
  • Error Handling: Comprehensive error handling with specific error messages
  • Library Availability Checks: Robust checking for required libraries before processing
  • Batch Processing: Efficient processing of multiple files with individual status tracking

Usage

  1. Visit the Application: Navigate to the application URL
  2. Upload Files: Drag and drop JPEG/HEIC files or click to select files
    • Multiple File Support: Upload up to 60 files simultaneously
    • Format Support: Both JPEG and HEIC formats are fully supported
    • Automatic Detection: Files are automatically validated and categorized
  3. Start Processing: Click "Start OCR & Math Processing" to begin
    • HEIC Conversion: HEIC files are automatically converted to JPEG
    • Progress Tracking: Monitor real-time progress for each file
    • Error Handling: Any processing errors are clearly displayed
  4. Monitor Progress: Watch detailed progress updates for each file
    • Conversion Phase: HEIC files show conversion progress
    • OCR Phase: Text extraction progress with percentage completion
    • Formula Detection: Mathematical formula detection and counting
  5. Download Results: Click "Download HTML with Math" to get formatted HTML
    • Enhanced Output: HTML includes file type indicators and processing notes
    • Mathematical Formulas: All detected formulas rendered with MathJax
    • Processing Summary: Detailed statistics about the conversion process

Troubleshooting

HEIC File Issues

  • Conversion Failures: If HEIC conversion fails, check file integrity and try re-uploading
  • Library Loading: The application automatically retries library loading up to 50 times
  • Browser Compatibility: Ensure your browser supports modern JavaScript features

OCR Processing Issues

  • Low Confidence: Poor image quality may result in low OCR confidence scores
  • Mathematical Formulas: Complex formulas may require manual review in the output
  • Large Files: Very large images may take longer to process

Performance Optimization

  • Batch Size: For best performance, process files in batches of 10-20
  • Image Quality: Higher quality images produce better OCR results
  • File Size: Compress large images before upload for faster processing

Technology Stack

  • Backend: Hono.js for API routes
  • Frontend: React with TypeScript
  • OCR: Tesseract.js for general text recognition
  • Math OCR: Specialized mathematical formula recognition
  • Math Rendering: MathJax for LaTeX formula display in HTML
  • Image Processing: HEIC to JPEG conversion support
  • Styling: TailwindCSS
Code
backendfrontenduntitled-folder-2697README.mdmain.ts
H
new-file-3657.ts
new-file-9836.ts
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.