Skip to content

Commit a6a3514

Browse files
committed
Removed unrequired code in visual tests
1 parent d37ba51 commit a6a3514

1 file changed

Lines changed: 0 additions & 21 deletions

File tree

test/visual.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,27 +85,6 @@ def render_agg(m, output, scale_factor):
8585
if platform.uname()[0] == 'Darwin':
8686
COMPUTE_THRESHOLD = 2
8787

88-
# returns true if pixels are not identical
89-
def compare_pixels(pixel1, pixel2, alpha=True):
90-
if pixel1 == pixel2:
91-
return False
92-
r_diff = abs((pixel1 & 0xff) - (pixel2 & 0xff))
93-
g_diff = abs(((pixel1 >> 8) & 0xff) - ((pixel2 >> 8) & 0xff))
94-
b_diff = abs(((pixel1 >> 16) & 0xff)- ((pixel2 >> 16) & 0xff))
95-
if alpha:
96-
a_diff = abs(((pixel1 >> 24) & 0xff) - ((pixel2 >> 24) & 0xff))
97-
if(r_diff > COMPUTE_THRESHOLD or
98-
g_diff > COMPUTE_THRESHOLD or
99-
b_diff > COMPUTE_THRESHOLD or
100-
a_diff > COMPUTE_THRESHOLD):
101-
return True
102-
else:
103-
if(r_diff > COMPUTE_THRESHOLD or
104-
g_diff > COMPUTE_THRESHOLD or
105-
b_diff > COMPUTE_THRESHOLD):
106-
return True
107-
return False
108-
10988
# compare two images and return number of different pixels
11089
def compare(actual, expected, alpha=True):
11190
im1 = mapnik.Image.open(actual)

0 commit comments

Comments
 (0)