From: Marcel Werk Date: Tue, 29 Mar 2022 12:01:36 +0000 (+0200) Subject: Incorrect handling of GIF cover photos when rebuilding users X-Git-Tag: 5.4.16_dev_1~17 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=38c0e2dbeb9fe4f26392da5498b76655b3643b7e;p=GitHub%2FWoltLab%2FWCF.git Incorrect handling of GIF cover photos when rebuilding users --- diff --git a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php index eeb12f0d76..4882f0c7a2 100644 --- a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php @@ -322,10 +322,17 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker } if ($coverPhoto instanceof IWebpUserCoverPhoto) { - $coverPhoto->createWebpVariant(); - $editor->update([ - 'coverPhotoHasWebP' => 1, - ]); + $result = $coverPhoto->createWebpVariant(); + if ($result !== null) { + $data['coverPhotoHasWebP'] = 1; + + // A fallback jpeg image was just created. + if ($result === false) { + $data['coverPhotoExtension'] = 'jpg'; + } + + $editor->update($data); + } } } }