mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Merge pull request #7 from the01/master
The changes as they are persist the default behaviour, so there's no problem with merging them.
This commit is contained in:
commit
dbe2df0cad
@ -37,6 +37,7 @@ class Command(BaseCommand):
|
|||||||
CONSUME = settings.CONSUMPTION_DIR
|
CONSUME = settings.CONSUMPTION_DIR
|
||||||
|
|
||||||
OCR = pyocr.get_available_tools()[0]
|
OCR = pyocr.get_available_tools()[0]
|
||||||
|
OCR_LANG = settings.TESSERACT_LANGUAGE
|
||||||
MEDIA_PDF = os.path.join(settings.MEDIA_ROOT, "documents", "pdf")
|
MEDIA_PDF = os.path.join(settings.MEDIA_ROOT, "documents", "pdf")
|
||||||
|
|
||||||
PARSER_REGEX_TITLE = re.compile(r"^.*/(.*)\.pdf$")
|
PARSER_REGEX_TITLE = re.compile(r"^.*/(.*)\.pdf$")
|
||||||
@ -135,7 +136,7 @@ class Command(BaseCommand):
|
|||||||
for png in pngs:
|
for png in pngs:
|
||||||
with Image.open(os.path.join(self.SCRATCH, png)) as f:
|
with Image.open(os.path.join(self.SCRATCH, png)) as f:
|
||||||
self._render(" {}".format(f.filename), 3)
|
self._render(" {}".format(f.filename), 3)
|
||||||
r += self.OCR.image_to_string(f)
|
r += self.OCR.image_to_string(f, lang=self.OCR_LANG)
|
||||||
r += "\n\n\n\n\n\n\n\n"
|
r += "\n\n\n\n\n\n\n\n"
|
||||||
|
|
||||||
return r
|
return r
|
||||||
|
@ -126,6 +126,9 @@ USE_L10N = True
|
|||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
|
|
||||||
|
# Tesseract language setting
|
||||||
|
TESSERACT_LANGUAGE = "eng"
|
||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/1.9/howto/static-files/
|
# https://docs.djangoproject.com/en/1.9/howto/static-files/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user