diff --git a/tests/reference/5_1_7/kibom-variant_3_txt-3D_top.png b/tests/reference/5_1_7/kibom-variant_3_txt-3D_top.png index 7f06d820..86b36c54 100644 Binary files a/tests/reference/5_1_7/kibom-variant_3_txt-3D_top.png and b/tests/reference/5_1_7/kibom-variant_3_txt-3D_top.png differ diff --git a/tests/reference/6_0_8/kibom-variant_3_txt-3D_top.png b/tests/reference/6_0_8/kibom-variant_3_txt-3D_top.png index 2a9b52c7..c28186fc 100644 Binary files a/tests/reference/6_0_8/kibom-variant_3_txt-3D_top.png and b/tests/reference/6_0_8/kibom-variant_3_txt-3D_top.png differ diff --git a/tests/reference/7_0_0/kibom-variant_3_txt-3D_top.png b/tests/reference/7_0_0/kibom-variant_3_txt-3D_top.png index c48a6928..c762bbbe 100644 Binary files a/tests/reference/7_0_0/kibom-variant_3_txt-3D_top.png and b/tests/reference/7_0_0/kibom-variant_3_txt-3D_top.png differ diff --git a/tests/test_plot/test_step.py b/tests/test_plot/test_step.py index 8667f745..07694310 100644 --- a/tests/test_plot/test_step.py +++ b/tests/test_plot/test_step.py @@ -151,7 +151,7 @@ def test_render_3d_variant_1(test_dir): # Check all outputs are there name = prj+'-3D_top.png' ctx.expect_out_file(name) - ctx.compare_image(name, fuzz='8%', tol=1000) + ctx.compare_image(name, fuzz='48%', tol=1000, trim=True) ctx.clean_up(keep_project=True) diff --git a/tests/utils/context.py b/tests/utils/context.py index 63a66128..b1782c56 100644 --- a/tests/utils/context.py +++ b/tests/utils/context.py @@ -486,7 +486,7 @@ class TestContext(object): return self.search_not_in_file(os.path.join(self.sub_dir, file), texts) def compare_image(self, image, reference=None, diff='diff.png', ref_out_dir=False, fuzz='5%', tol=0, height='87%', - off_y='0', sub=False): + off_y='0', sub=False, trim=False): """ For images and single page PDFs """ if reference is None: reference = image @@ -505,6 +505,9 @@ class TestContext(object): png_image = image[:-3]+'png' subprocess.check_call(['rsvg-convert', '-d', '300', '-p', '300', '-o', png_image, image]) image = png_image + if trim: + cmd = ['convert', image, '-trim', image] + subprocess.run(cmd) cmd = ['compare', # Tolerate 5 % error in color '-fuzz', fuzz,