From 7e1152603f1a083566241527ef2a615104c91395 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 1 Feb 2023 13:23:35 +0100 Subject: feat(theming): Only convert a background image if it benefits from it * WebP images are generally quite small, converting to pngs would increase the filesize a lot. * Small JPEG and PNG images do not benefit from any conversion, so skip it. * JPEG images will get quite bigger when converted to PNG so instead convert to progressive JPEG Signed-off-by: Ferdinand Thiessen --- apps/theming/tests/ImageManagerTest.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'apps/theming/tests') diff --git a/apps/theming/tests/ImageManagerTest.php b/apps/theming/tests/ImageManagerTest.php index ffb023c970f..22432a00103 100644 --- a/apps/theming/tests/ImageManagerTest.php +++ b/apps/theming/tests/ImageManagerTest.php @@ -337,9 +337,12 @@ class ImageManagerTest extends TestCase { public function dataUpdateImage() { return [ - ['background', __DIR__ . '/../../../tests/data/testimage.png', true, true], - ['background', __DIR__ . '/../../../tests/data/testimage.png', false, true], - ['background', __DIR__ . '/../../../tests/data/testimage.jpg', true, true], + ['background', __DIR__ . '/../../../tests/data/testimage.png', true, false], + ['background', __DIR__ . '/../../../tests/data/testimage.png', false, false], + ['background', __DIR__ . '/../../../tests/data/testimage.jpg', true, false], + ['background', __DIR__ . '/../../../tests/data/testimage.webp', true, false], + ['background', __DIR__ . '/../../../tests/data/testimage-large.jpg', true, true], + ['background', __DIR__ . '/../../../tests/data/testimage-wide.png', true, true], ['logo', __DIR__ . '/../../../tests/data/testimagelarge.svg', true, false], ]; } -- cgit v1.2.3