namespace wcf\data\user\avatar;
use wcf\data\DatabaseObjectEditor;
+use wcf\system\exception\NotImplementedException;
use wcf\system\image\ImageHandler;
use wcf\system\WCF;
use wcf\util\FileUtil;
// If the uploaded avatar is already a WebP image, then create a JPEG
// as a fallback image and flip the image data to match the JPEG.
if ($this->avatarExtension === "webp") {
+ // This entire code path is completely broken, because writing into the
+ // ->data array of the UserAvatarEditor does not actually do anything
+ // for ->getLocation(), which is a method on the base UserAvatar.
+ // This is also unreachable, because WebP files are rejected unconditionally
+ // in AvatarUploadFileValidationStrategy.
+ throw new NotImplementedException();
+
$filenameJpeg = \preg_replace('~\.webp$~', '.jpeg', $filenameWebP);
$imageAdapter->saveImageAs($image, $filenameJpeg, "jpeg", 80);