mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Removes last vestiges of PNG from the tests, code, docs and samples
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 7.7 KiB |
BIN
src/documents/tests/samples/documents/thumbnails/0000001.webp
Normal file
BIN
src/documents/tests/samples/documents/thumbnails/0000001.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.7 KiB |
BIN
src/documents/tests/samples/documents/thumbnails/0000002.webp
Normal file
BIN
src/documents/tests/samples/documents/thumbnails/0000002.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.7 KiB |
BIN
src/documents/tests/samples/documents/thumbnails/0000003.webp
Normal file
BIN
src/documents/tests/samples/documents/thumbnails/0000003.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
Binary file not shown.
@@ -176,7 +176,7 @@ class TestDocumentApi(DirectoriesMixin, APITestCase):
|
||||
)
|
||||
|
||||
with open(
|
||||
os.path.join(self.dirs.thumbnail_dir, f"{doc.pk:07d}.png"),
|
||||
os.path.join(self.dirs.thumbnail_dir, f"{doc.pk:07d}.webp"),
|
||||
"wb",
|
||||
) as f:
|
||||
f.write(content_thumbnail)
|
||||
@@ -1022,7 +1022,7 @@ class TestDocumentApi(DirectoriesMixin, APITestCase):
|
||||
"samples",
|
||||
"documents",
|
||||
"thumbnails",
|
||||
"0000001.png",
|
||||
"0000001.webp",
|
||||
)
|
||||
archive_file = os.path.join(os.path.dirname(__file__), "samples", "simple.pdf")
|
||||
|
||||
|
@@ -180,7 +180,7 @@ class DummyParser(DocumentParser):
|
||||
|
||||
def __init__(self, logging_group, scratch_dir, archive_path):
|
||||
super().__init__(logging_group, None)
|
||||
_, self.fake_thumb = tempfile.mkstemp(suffix=".png", dir=scratch_dir)
|
||||
_, self.fake_thumb = tempfile.mkstemp(suffix=".webp", dir=scratch_dir)
|
||||
self.archive_path = archive_path
|
||||
|
||||
def get_thumbnail(self, document_path, mime_type, file_name=None):
|
||||
@@ -199,7 +199,7 @@ class CopyParser(DocumentParser):
|
||||
|
||||
def __init__(self, logging_group, progress_callback=None):
|
||||
super().__init__(logging_group, progress_callback)
|
||||
_, self.fake_thumb = tempfile.mkstemp(suffix=".png", dir=self.tempdir)
|
||||
_, self.fake_thumb = tempfile.mkstemp(suffix=".webp", dir=self.tempdir)
|
||||
|
||||
def parse(self, document_path, mime_type, file_name=None):
|
||||
self.text = "The text"
|
||||
@@ -214,7 +214,7 @@ class FaultyParser(DocumentParser):
|
||||
|
||||
def __init__(self, logging_group, scratch_dir):
|
||||
super().__init__(logging_group)
|
||||
_, self.fake_thumb = tempfile.mkstemp(suffix=".png", dir=scratch_dir)
|
||||
_, self.fake_thumb = tempfile.mkstemp(suffix=".webp", dir=scratch_dir)
|
||||
|
||||
def get_thumbnail(self, document_path, mime_type, file_name=None):
|
||||
return self.fake_thumb
|
||||
@@ -230,6 +230,8 @@ def fake_magic_from_file(file, mime=False):
|
||||
return "application/pdf"
|
||||
elif os.path.splitext(file)[1] == ".png":
|
||||
return "image/png"
|
||||
elif os.path.splitext(file)[1] == ".webp":
|
||||
return "image/webp"
|
||||
else:
|
||||
return "unknown"
|
||||
else:
|
||||
|
@@ -150,9 +150,9 @@ class TestDecryptDocuments(TestCase):
|
||||
"samples",
|
||||
"documents",
|
||||
"thumbnails",
|
||||
f"0000004.png.gpg",
|
||||
f"0000004.webp.gpg",
|
||||
),
|
||||
os.path.join(thumb_dir, f"{doc.id:07}.png.gpg"),
|
||||
os.path.join(thumb_dir, f"{doc.id:07}.webp.gpg"),
|
||||
)
|
||||
|
||||
call_command("decrypt_documents")
|
||||
|
@@ -42,9 +42,9 @@ class TestSanityCheck(DirectoriesMixin, TestCase):
|
||||
"samples",
|
||||
"documents",
|
||||
"thumbnails",
|
||||
"0000001.png",
|
||||
"0000001.webp",
|
||||
),
|
||||
os.path.join(self.dirs.thumbnail_dir, "0000001.png"),
|
||||
os.path.join(self.dirs.thumbnail_dir, "0000001.webp"),
|
||||
)
|
||||
|
||||
return Document.objects.create(
|
||||
|
Reference in New Issue
Block a user