Don't try to resize a svg uploaded as background image.

image* are gd functions without support for svg hence we are not able to resize svg.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2020-03-01 00:34:28 +01:00
parent 72cc8270cd
commit e35b76a12b
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
1 changed files with 1 additions and 2 deletions

View File

@ -280,8 +280,7 @@ class ThemingController extends Controller {
);
}
$resizeKeys = ['background'];
if (in_array($key, $resizeKeys, true)) {
if ($key === 'background' && strpos($detectedMimeType, 'image/svg') === false) {
// Optimize the image since some people may upload images that will be
// either to big or are not progressive rendering.
$newImage = @imagecreatefromstring(file_get_contents($image['tmp_name'], 'r'));