danmunn / redmine_dmsf

Fork of svn repository for redmine_dmsf
GNU General Public License v2.0
413 stars 193 forks source link

omindex with tesseract filter for scanned PDFs #1481

Open whotopia opened 8 months ago

whotopia commented 8 months ago

Hi, this may be more of an Xampian/Omega/tesseract question, but I was wondering, noting the following section in xapian_indexer.rb:

# omindex binary path
# To index "non-text" files, use omindex filters
# e.g.: tesseract OCR engine as a filter for PNG files
OMINDEX = '/usr/bin/omindex'
# $omindex += " --filter=image/png:'tesseract -l chi_sim+chi_tra %f -'"
# $omindex += " --filter=image/jpeg:'tesseract -l chi_sim+chi_tra %f -'"

I was wondering, if I had PDF files being uploaded to the DMS that were of mixed types .. i.e. some are 'proper' PDFs and others are PDFs containing scanned content with no OCR content in them. How would it be possible to set things up so that tesseract was called to OCR only when needed?