Since the introduction of these packages, we are seeing test failures for PNG images.
Reproduction
docker run --user root --entrypoint /bin/bash -it docker-registry.wikimedia.org/wikimedia/operations-software-thumbor-plugins:2023-02-27-151612-production # our prod images don't have any build tools apt update; apt install make python3-pytest flake8; ln -s /usr/bin/pytest-3 /usr/bin/pytest # successfully run the test make test apt install -y libmagickcore-6.q16-6 apt install -y libmagickwand-6.q16-6 # tests will now fail make test
Some failures we see:
tests/integration/test_png.py:58: tests/integration/__init__.py:182: in run_and_check_ssim_and_size raise e self = <tests.integration.test_png.WikimediaTest testMethod=test_transparent>, url = '/thumbor/unsafe/400x/PNG_transparency_demonstration_1.png', mediawiki_reference_thumbnail = '400px-PNG_transparency_demonstration_1.png', perfect_reference_thumbnail = '400px-PNG_transparency_demonstration_1.png', expected_width = 400, expected_height = 300 expected_ssim = 0.97, size_tolerance = 1.1 try: > assert ssim >= expected_ssim, 'Images too dissimilar: %f (should be >= %f)\n' % (ssim, expected_ssim) E AssertionError: Images too dissimilar: 0.951071 (should be >= 0.970000) tests/integration/test_vips.py:175: self = <tests.integration.test_vips.WikimediaVipsTest testMethod=test_skip_factor_1>, url = '/thumbor/unsafe/2000x/filters:format(png)/Lakedaimoniergrab_Zeichnung_und_Steinplan.png', mediawiki_reference_thumbnail = '2000px-Lakedaimoniergrab_Zeichnung_und_Steinplan.png', perfect_reference_thumbnail = '2000px-Lakedaimoniergrab_Zeichnung_und_Steinplan.png' expected_width = 2000, expected_height = 987, expected_ssim = 0.99, size_tolerance = 1.01 SNIP expected_filesize = os.path.getsize(expected_path) generated_filesize = len(result.buffer.getvalue()) ratio = generated_filesize / expected_filesize assert ratio <= size_tolerance, \ > 'Generated file bigger than size tolerance: %f (should be <= %f)' % (ratio, size_tolerance) E AssertionError: Generated file bigger than size tolerance: 1.014739 (should be <= 1.010000) self = <tests.integration.test_webp.WikimediaTest testMethod=test_webp>, url = '/thumbor/unsafe/300x/filters:format(png)/Album_en_blanco_y_negro.webp', mediawiki_reference_thumbnail = '300px-Album_en_blanco_y_negro.webp.png', perfect_reference_thumbnail = '300px-Album_en_blanco_y_negro.webp.png', expected_width = 300, expected_height = 202, expected_ssim = 0.99 size_tolerance = 1.06 <SNIP> expected_filesize = os.path.getsize(expected_path) generated_filesize = len(result.buffer.getvalue()) ratio = generated_filesize / expected_filesize assert ratio <= size_tolerance, \ > 'Generated file bigger than size tolerance: %f (should be <= %f)' % (ratio, size_tolerance) E AssertionError: Generated file bigger than size tolerance: 1.065725 (should be <= 1.060000) tests/integration/__init__.py:189: AssertionError