To support OCR feature.
This commit is contained in:
parent
82f7d1d2b3
commit
711ffc5954
@ -39,7 +39,11 @@ $files = 'dmsf'
|
|||||||
$scriptindex = '/usr/bin/scriptindex'
|
$scriptindex = '/usr/bin/scriptindex'
|
||||||
|
|
||||||
# omindex binary path
|
# 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 = '/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 -'"
|
||||||
|
|
||||||
# Directory containing Xapian databases for omindex (Attachments indexing)
|
# Directory containing Xapian databases for omindex (Attachments indexing)
|
||||||
$dbrootpath = File.expand_path('dmsf_index', $redmine_root)
|
$dbrootpath = File.expand_path('dmsf_index', $redmine_root)
|
||||||
@ -91,7 +95,7 @@ ENV['RAILS_ENV'] = $env
|
|||||||
|
|
||||||
def log(text, error = false)
|
def log(text, error = false)
|
||||||
if error
|
if error
|
||||||
$stderr.warn text
|
$stderr.puts text
|
||||||
elsif $verbose > 0
|
elsif $verbose > 0
|
||||||
$stdout.puts text
|
$stdout.puts text
|
||||||
end
|
end
|
||||||
@ -117,12 +121,12 @@ end
|
|||||||
log "Redmine environment [RAILS_ENV=#{$env}] correctly loaded ..."
|
log "Redmine environment [RAILS_ENV=#{$env}] correctly loaded ..."
|
||||||
|
|
||||||
# Indexing documents
|
# Indexing documents
|
||||||
unless File.exist?($omindex)
|
# unless File.exist?($omindex)
|
||||||
log "#{$omindex} does not exist, exiting...", true
|
# log "#{$omindex} does not exist, exiting...", true
|
||||||
exit 1
|
# exit 1
|
||||||
end
|
# end
|
||||||
$stem_langs.each do | lang |
|
$stem_langs.each do | lang |
|
||||||
filespath = File.join($redmine_root, $files)
|
filespath = Setting.plugin_redmine_dmsf['dmsf_storage_directory'] || File.join($redmine_root, $files)
|
||||||
unless File.directory?(filespath)
|
unless File.directory?(filespath)
|
||||||
log "An error while accessing #{filespath}, exiting...", true
|
log "An error while accessing #{filespath}, exiting...", true
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user