ReceiptManager / receipt-parser-legacy

A supermarket receipt parser written in Python using tesseract OCR

Home Page:https://tech.trivago.com/2015/10/06/python_receipt_parser/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

convert: no decode delegate for this image format `JPEG' @ error/constitute.c/ReadImage/508.

jacobkrahn opened this issue · comments

I receive this error when trying to run the program, in addition to many following errors.

Solutions that didn't work

brew unlink jpeg and then brew link jpeg
brew install jpeg; brew link jpeg

brew uninstall imagemagick jpeg libtiff jasper; brew install imagemagick

make run
pipenv run python parser/importer.py
/Usr/.local/share/virtualenvs/receipt-parser-master-rh6oEQUF/bin/python
('Found the following images in', '/Usr/Downloads/receipt-parser-master/data/img')
['IMG0008.jpg', 'IMG0003.jpg', 'IMG0001.jpg', 'IMG0004.jpg', 'IMG0007.jpg', 'IMG0006.jpg']
('Running', "convert -rotate ' 90' '/Usr/Downloads/receipt-parser-master/data/img/IMG0008.jpg' '/Usr/Downloads/receipt-parser-master/data/tmp/IMG0008.jpg'")
convert: no decode delegate for this image format JPEG' @ error/constitute.c/ReadImage/508. convert: no images defined /Usr/Downloads/receipt-parser-master/data/tmp/IMG0008.jpg' @ error/convert.c/ConvertImageCommand/3235.
('Running', "convert -auto-level -sharpen 0x4.0 -contrast '/Usr/Downloads/receipt-parser-master/data/tmp/IMG0008.jpg' '/Usr/Downloads/receipt-parser-master/data/tmp/IMG0008.jpg'")
convert: unable to open image '/Usr/Downloads/receipt-parser-master/data/tmp/IMG0008.jpg': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format JPG' @ error/constitute.c/ReadImage/508. convert: no images defined /Usr/Downloads/receipt-parser-master/data/tmp/IMG0008.jpg' @ error/convert.c/ConvertImageCommand/3235.
('Running', "tesseract -l deu '/Usr/Downloads/receipt-parser-master/data/tmp/IMG0008.jpg' '/Usr/Downloads/receipt-parser-master/data/txt/IMG0008.jpg.out.txt'")
sh: tesseract: command not found
('Running', "convert -rotate ' 90' '/Usr/Downloads/receipt-parser-master/data/img/IMG0003.jpg' '/Usr/Downloads/receipt-parser-master/data/tmp/IMG0003.jpg'")
convert: no decode delegate for this image format JPEG' @ error/constitute.c/ReadImage/508. convert: no images defined /Usr/Downloads/receipt-parser-master/data/tmp/IMG0003.jpg' @ error/convert.c/ConvertImageCommand/3235.
('Running', "convert -auto-level -sharpen 0x4.0 -contrast '/Usr/Downloads/receipt-parser-master/data/tmp/IMG0003.jpg' '/Usr/Downloads/receipt-parser-master/data/tmp/IMG0003.jpg'")

I need to install some delegates apparantly

$ convert --version
Version: ImageMagick 7.0.2-0 Q16 x86_64 2016-06-17 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI
Delegates (built-in): bzlib

I have no idea how to do it though, they're here http://www.imagemagick.org/download/delegates/ but I don't know what to do with the files.

When I run

sudo yum install ImageMagick-devel
wget http://www.imagemagick.org/download/delegates/jpegsr9b.zip
tar xvfz jpegsr9b.zip
cd jpegsr9b
./configure

I get the error

-bash: ./configure: /bin/bash^M: bad interpreter: No such file or directory

So it's fixed

brew link --overwrite imagemagick

Might have fixed it, but maybe not.