From 1cbbed1414294cfa7c8c1cd1d05f260388822119 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 20 Mar 2024 06:36:28 -0300 Subject: [PATCH] [Tests][Changed] SVG -> PNG conversion - Now using a fixed height instead of 300 dpi - Helps when comparing using different OS libs --- tests/utils/context.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/utils/context.py b/tests/utils/context.py index 06279b54..c8ff6938 100644 --- a/tests/utils/context.py +++ b/tests/utils/context.py @@ -550,13 +550,19 @@ class TestContext(object): png_ref = None if reference[-3:] == 'svg': png_ref = reference[:-3]+'png' - subprocess.check_call(['rsvg-convert', '-d', '300', '-p', '300', '-o', png_ref, reference]) + cmd = ['rsvg-convert', '-h', '2160', '-o', png_ref, reference] + logging.debug('Converting reference to PNG with: '+usable_cmd(cmd)) + subprocess.check_call(cmd) reference = png_ref + assert os.path.isfile(png_ref) png_image = None if image[-3:] == 'svg': png_image = image[:-3]+'png' - subprocess.check_call(['rsvg-convert', '-d', '300', '-p', '300', '-o', png_image, image]) + cmd = ['rsvg-convert', '-h', '2160', '-o', png_image, image] + logging.debug('Converting result image to PNG with: '+usable_cmd(cmd)) + subprocess.check_call(cmd) image = png_image + assert os.path.isfile(png_image) if trim: cmd = ['convert', image, '-trim', image] subprocess.run(cmd)