imageService->getUserFilePreviewFile($id, $this->userId, $x, $y); if ($preview === null) { $this->logger->error('No preview for user "' . $this->userId . '"'); return new DataResponse('', Http::STATUS_NOT_FOUND); } if ($preview['type'] === 'file') { return new DataDownloadResponse( $preview['file']->getContent(), (string)Http::STATUS_OK, $preview['file']->getMimeType() ); } elseif ($preview['type'] === 'icon') { return new RedirectResponse($preview['icon']); } } catch (Exception|Throwable $e) { $this->logger->error('getImage error', ['exception' => $e]); return new DataResponse('', Http::STATUS_NOT_FOUND); } return new DataResponse('', Http::STATUS_NOT_FOUND); } }