mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-07 15:25:41 +01:00
parent
1e7ece81ee
commit
c34d57a872
1 changed files with 3 additions and 0 deletions
|
|
@ -28,6 +28,9 @@ from .languages import ISO639
|
||||||
def image_to_string(args):
|
def image_to_string(args):
|
||||||
self, png, lang = args
|
self, png, lang = args
|
||||||
with Image.open(os.path.join(self.SCRATCH, png)) as f:
|
with Image.open(os.path.join(self.SCRATCH, png)) as f:
|
||||||
|
if self.OCR.can_detect_orientation():
|
||||||
|
orientation = self.OCR.detect_orientation(f, lang=lang)
|
||||||
|
f = f.rotate(orientation["angle"], expand=1)
|
||||||
return self.OCR.image_to_string(f, lang=lang)
|
return self.OCR.image_to_string(f, lang=lang)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue