{"id":28075246,"url":"https://github.com/n-jangra/img-ocr","last_synced_at":"2025-07-23T18:04:27.695Z","repository":{"id":292709329,"uuid":"981696087","full_name":"N-Jangra/img-ocr","owner":"N-Jangra","description":"This repository is a Go wrapper for Tesseract OCR using the gosseract package. It enables developers to easily integrate Optical Character Recognition (OCR) functionality into their Go applications, leveraging the power of Tesseract for text extraction from images.","archived":false,"fork":false,"pushed_at":"2025-05-11T17:39:51.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T00:55:39.104Z","etag":null,"topics":["golang","gotemplate","html-css","img","ocr-text-reader"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/N-Jangra.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-11T17:33:04.000Z","updated_at":"2025-05-11T17:39:55.000Z","dependencies_parsed_at":"2025-05-11T18:42:50.370Z","dependency_job_id":null,"html_url":"https://github.com/N-Jangra/img-ocr","commit_stats":null,"previous_names":["n-jangra/img-ocr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/N-Jangra/img-ocr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N-Jangra%2Fimg-ocr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N-Jangra%2Fimg-ocr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N-Jangra%2Fimg-ocr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N-Jangra%2Fimg-ocr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/N-Jangra","download_url":"https://codeload.github.com/N-Jangra/img-ocr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N-Jangra%2Fimg-ocr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266726592,"owners_count":23974924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","gotemplate","html-css","img","ocr-text-reader"],"created_at":"2025-05-13T00:55:37.639Z","updated_at":"2025-07-23T18:04:27.675Z","avatar_url":"https://github.com/N-Jangra.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"#\n##  Go OCR Web App\n\nA simple web application built with **Golang** that allows users to:\n\n* Upload or drag-and-drop an image\n* Extract text from the image using **OCR (Optical Character Recognition)**\n* View the uploaded image and extracted text in the browser\n* Copy the text manually (no JavaScript required)\n\n---\n\n##  What It Does\n\nThis application provides a web interface to upload image files (JPG, PNG, etc.). It uses the **Tesseract OCR engine** via the `gosseract` Go library to process the image and extract any readable text.\n\nAfter submission:\n\n1. The image is uploaded and stored in the `uploads/` directory.\n2. OCR is performed server-side.\n3. The webpage reloads and displays:\n\n   * The uploaded image\n   * Extracted text in a `\u003ctextarea\u003e`\n\nNo client-side scripting (JavaScript) is required for image processing or rendering.\n\n---\n\n##  Features\n\n*  Upload image through form\n*  Displays uploaded image\n*  Extracts text using Tesseract\n*  Displays extracted text\n*  Copy/paste manually\n\n---\n\n##  Requirements\n\n### 1. System Dependencies\n\nYou must have **Tesseract OCR** and its dependencies (Leptonica) installed:\n\n####  Linux (Ubuntu/Debian)\n\n```bash\nsudo apt update\nsudo apt install -y tesseract-ocr libtesseract-dev libleptonica-dev\n```\n\n####  macOS (with Homebrew)\n\n```bash\nbrew install tesseract\n```\n\n####  Windows\n\n* Download the installer from: [https://github.com/UB-Mannheim/tesseract/wiki](https://github.com/UB-Mannheim/tesseract/wiki)\n* Add the installation path (e.g., `C:\\Program Files\\Tesseract-OCR`) to your system `PATH`\n* Set `TESSDATA_PREFIX` to `C:\\Program Files\\Tesseract-OCR\\tessdata`\n\n---\n\n### 2. Go Dependencies\n\n```bash\ngo install\ngo get github.com/otiai10/gosseract/v2\n```\n\n---\n\n## 🗂 Project Structure\n\n```\ngo-ocr-app/\n├── cmd/\n│   └── server/\n│       └── main.go              # Entry point\n├── internal/\n│   └── handlers/\n│       └── upload.go            # Form and OCR logic\n│   └── templates/\n│       └── index.gohtml         # HTML rendering\n├── static/\n│   └── style.css                # CSS styles\n├── uploads/                     # Uploaded image files\n├── go.mod\n└── go.sum\n```\n\n---\n\n##  How to Run\n\n### 1. Clone the Repo (or create the structure)\n\n```bash\ngit clone https://github.com/N-Jangra/img-ocr\ncd img-ocr\n```\n\n### 2. Initialize Go Module\n\n```bash\ngo mod tidy\n```\n\n### 3. Run the Server\n\n```bash\ngo run main.go\n```\n\n### 4. Open in Your Browser\n\nGo to: [http://localhost:8080](http://localhost:8080)\n\n---\n\n##  How It Works\n\n* The HTML form uploads the image via `POST /upload`\n* Go handles the request:\n\n  * Saves the image in `/uploads/`\n  * Uses `gosseract` to extract text\n  * Renders the same HTML template with image and text data\n* The `uploads/` folder is statically served, so the image preview is just a `\u003cimg\u003e` pointing to `/uploads/\u003cfilename\u003e`\n\n---\n\n##  License\n\nThis project is open-source and free to use under the [MIT License](LICENSE).\n\n#\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn-jangra%2Fimg-ocr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn-jangra%2Fimg-ocr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn-jangra%2Fimg-ocr/lists"}