Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeFnord committed Jun 26, 2023
0 parents commit ede0deb
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Original work Copyright (c) 2013 Marco Azimonti
Modified work Copyright (c) 2015 Matteo Maggioni
Modified work Copyright (c) 2017 Oswell Chan

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Heroku Buildpack Tesseract

This package provides a custom Heroku buildpack providing the [Tesseract OCR](https://github.com/tesseract-ocr/tesseract) binary and all the required libraries to Heroku apps. Training data for English language is provided.

## Configuration


1. add teh buildpack
```
heroku buildpacks:add https://github.com/teketekepon/heroku-buildpack-tesseract
```
or add by copy the URL in the Dashboard to add the buildpack.
2. you can use the `tesseract` binary in your Heroku app!
3. deploy :)
## Note
This fork uses the Tesseract version 5.3.1
## License
MIT License.
Original work Copyright (c) 2013 Marco Azimonti
Modified work Copyright (c) 2015 Matteo Maggioni
Modified work Copyright (c) 2015 Oswell Chan
Modified work Copyright (c) 2018 Malcolm Patterson
Modified work Copyright (c) 2020 Takahiro Furukawa
18 changes: 18 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
BUILD_DIR=$1
TESSERACT_OCR_VERSION=5.3.1
TESSERACT_OCR_TGZ=tesseract-$TESSERACT_OCR_VERSION.tar.gz

INSTALL_DIR=$BUILD_DIR/vendor/tesseract-ocr/
TESSERACT_OCR_DIR=${HOME}/vendor/tesseract-ocr
ENVSCRIPT=$BUILD_DIR/.profile.d/tesseract-ocr.sh

echo "Unpacking Tesseract-OCR binaries"
mkdir -p $INSTALL_DIR
tar -zxvf $TESSERACT_OCR_TGZ -C $INSTALL_DIR

echo "Building runtime environment for Tesseract-OCR"
mkdir -p $BUILD_DIR/.profile.d
echo "export PATH=\"$TESSERACT_OCR_DIR/bin:\$PATH\"" > $ENVSCRIPT
echo "export LD_LIBRARY_PATH=\"$TESSERACT_OCR_DIR/lib:\$LD_LIBRARY_PATH\"" >> $ENVSCRIPT
echo "export TESSDATA_PREFIX=\"$TESSERACT_OCR_DIR/share/tessdata\"" >> $ENVSCRIPT
2 changes: 2 additions & 0 deletions bin/detect
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "detect"
2 changes: 2 additions & 0 deletions bin/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "--- {}"
Binary file added tesseract-5.3.1.tar.gz
Binary file not shown.

0 comments on commit ede0deb

Please sign in to comment.