diff options
author | Ferdinand Thiessen <rpm@fthiessen.de> | 2023-02-01 13:23:35 +0100 |
---|---|---|
committer | Ferdinand Thiessen <rpm@fthiessen.de> | 2023-02-20 13:11:19 +0100 |
commit | 7e1152603f1a083566241527ef2a615104c91395 (patch) | |
tree | 323e16faadc62280cbf8672d372ddc486acfa15e /apps/theming/tests | |
parent | 95eeba83b6570b3cf7cbb79aea42222f7d3e03f4 (diff) | |
download | nextcloud-server-7e1152603f1a083566241527ef2a615104c91395.tar.gz nextcloud-server-7e1152603f1a083566241527ef2a615104c91395.zip |
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 <rpm@fthiessen.de>
Diffstat (limited to 'apps/theming/tests')
-rw-r--r-- | apps/theming/tests/ImageManagerTest.php | 9 |
1 files changed, 6 insertions, 3 deletions
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], ]; } |