some improvements

This commit is contained in:
ston1th 2019-08-26 19:58:31 +02:00
commit 58a0dc36d5
25 changed files with 233 additions and 105 deletions

View file

@ -106,6 +106,10 @@ func (s *Scanner) Scan(file string) (filename, text string, err error) {
var pdffile string
pdf := isPDF(scanfile)
if !pdf {
if !isImage(scanfile) {
err = errors.New("error: input file is not an image")
return
}
var (
pdf []byte
f *os.File