Merge pull request #19722 from nextcloud/bug/18727/dont-resize-svg

Don't try to resize a svg uploaded as background image
This commit is contained in:
Roeland Jago Douma 2020-03-02 07:40:01 +01:00 committed by GitHub
commit 1ef982a967
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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'));