Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages and install them manually as needed.
| #!/usr/bin/env bash | |
| # Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime which can be found at: | |
| # https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html | |
| # | |
| # As of May 21, 2019, this is: | |
| # Amazon Linux AMI 2018.03.0 (ami-0756fbca465a59a30) | |
| # | |
| # You need to prepend PATH with the folder containing these binaries in your Lambda function | |
| # to ensure these newer binaries are used. |
| class Api::UploadsController < ApiController | |
| def create | |
| @upload = Upload.new(upload_params) | |
| ensure | |
| clean_tempfile | |
| end | |
| private |
Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages and install them manually as needed.