Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add file to logs
  • Loading branch information
AliaksandrDziarkach committed Sep 20, 2023
1 parent 0a574d4 commit a62867b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/tests/integration/common/rendering/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import platform
import sys
import base64

from env_indigo import getPlatform, isIronPython, isJython

Expand Down Expand Up @@ -204,14 +205,17 @@ def checkBitmapSimilarity(filename, ref_filename):
return "%s rendering status: Problem: %s" % (filename, str(e))

channels = ["red", "green", "blue", "alpha"]
with open("%s/out/%s" % (dirname, filename), "rb") as file:
binary_data = file.read()
for i, result in enumerate(results):
if result > (HASH_SIZE**2) * 0.1:
return (
"%s rendering status: Problem: PNG similarity is %s for %s channel"
"%s rendering status: Problem: PNG similarity is %s for %s channel\n%s\n"
% (
filename,
round(1 - (result / float(HASH_SIZE**2)), 2),
channels[i],
base64.b64encode(binary_data),
)
)

Expand Down

0 comments on commit a62867b

Please sign in to comment.