mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-23 10:39:25 -05:00
Merge 3d8342cb4e0453706111099a58b1834c1130b676 into 5a278381e38c4583d6285d07bb922e5068a987d0
This commit is contained in:
commit
74ea03620f
@ -108,6 +108,7 @@ class RasterisedDocumentParser(DocumentParser):
|
||||
"image/bmp",
|
||||
"image/gif",
|
||||
"image/webp",
|
||||
"image/heic",
|
||||
]
|
||||
|
||||
def has_alpha(self, image) -> bool:
|
||||
|
@ -16,5 +16,6 @@ def tesseract_consumer_declaration(sender, **kwargs):
|
||||
"image/gif": ".gif",
|
||||
"image/bmp": ".bmp",
|
||||
"image/webp": ".webp",
|
||||
"image/heic": ".heic",
|
||||
},
|
||||
}
|
||||
|
BIN
src/paperless_tesseract/tests/samples/simple.heic
Normal file
BIN
src/paperless_tesseract/tests/samples/simple.heic
Normal file
Binary file not shown.
@ -880,6 +880,12 @@ class TestParserFileTypes(DirectoriesMixin, FileSystemAssertsMixin, TestCase):
|
||||
self.assertIsFile(parser.archive_path)
|
||||
self.assertIn("this is a test document", parser.get_text().lower())
|
||||
|
||||
def test_heic(self):
|
||||
parser = RasterisedDocumentParser(None)
|
||||
parser.parse(os.path.join(self.SAMPLE_FILES, "simple.heic"), "image/heic")
|
||||
self.assertIsFile(parser.archive_path)
|
||||
self.assertIn("pizza", parser.get_text().lower())
|
||||
|
||||
@override_settings(OCR_IMAGE_DPI=200)
|
||||
def test_gif(self):
|
||||
parser = RasterisedDocumentParser(None)
|
||||
|
Loading…
x
Reference in New Issue
Block a user