aboutsummaryrefslogtreecommitdiff
path: root/server/szurubooru
diff options
context:
space:
mode:
authorShyam Sunder2020-06-04 16:38:26 -0400
committerShyam Sunder2020-06-04 16:38:26 -0400
commitea675d20cb949eb53a3d93e723ea57d924cbbb2d (patch)
treea9f5867f2e8e29a4fd1d1d2dc7fc970a66265d76 /server/szurubooru
parent6a95a66f12a5407cfd8ffa7e373f756236bf0bce (diff)
server/docker: fix missing installation requirements
Furthermore, an update to Pillow has improved the floating-point precision of the image hash algorithm, requiring minor updates to the respective unit tests. See https://github.com/python-pillow/Pillow/pull/4320
Diffstat (limited to 'server/szurubooru')
-rw-r--r--server/szurubooru/tests/func/test_image_hash.py4
-rw-r--r--server/szurubooru/tests/func/test_posts.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/server/szurubooru/tests/func/test_image_hash.py b/server/szurubooru/tests/func/test_image_hash.py
index 1025291..13bfae8 100644
--- a/server/szurubooru/tests/func/test_image_hash.py
+++ b/server/szurubooru/tests/func/test_image_hash.py
@@ -15,7 +15,7 @@ def test_signature_functions(read_asset, config_injector):
assert array_equal(sig2, sig2_repacked)
dist1 = image_hash.normalized_distance([sig1], sig2)
- assert abs(dist1[0] - 0.20599895341812172) < 1e-8
+ assert abs(dist1[0] - 0.19713075553164386) < 1e-8
dist2 = image_hash.normalized_distance([sig2], sig2)
assert abs(dist2[0]) < 1e-8
@@ -23,4 +23,4 @@ def test_signature_functions(read_asset, config_injector):
words1 = image_hash.generate_words(sig1)
words2 = image_hash.generate_words(sig2)
words_match = sum(word1 == word2 for word1, word2 in zip(words1, words2))
- assert words_match == 17
+ assert words_match == 18
diff --git a/server/szurubooru/tests/func/test_posts.py b/server/szurubooru/tests/func/test_posts.py
index 097136c..49f93be 100644
--- a/server/szurubooru/tests/func/test_posts.py
+++ b/server/szurubooru/tests/func/test_posts.py
@@ -991,7 +991,7 @@ def test_search_by_image(post_factory, config_injector, read_asset):
result1 = posts.search_by_image(read_asset('jpeg-similar.jpg'))
assert len(result1) == 1
result1_distance, result1_post = result1[0]
- assert abs(result1_distance - 0.20599895341812172) < 1e-8
+ assert abs(result1_distance - 0.19713075553164386) < 1e-8
assert result1_post.post_id == post.post_id
result2 = posts.search_by_image(read_asset('png.png'))

© 2015 - 2026 Jakob L. Kreuze