mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-25 10:49:30 -05:00
Enhancement: support heic images (#9771)
This commit is contained in:
parent
5a278381e3
commit
00050f7c7b
@ -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