From a6b4bf07631cf00ed3f09daf19ba4ad8705b4f09 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 12 Jan 2026 13:21:09 +0100 Subject: [PATCH] fix(TaskProcessing): Refactor TextToImage fallback Signed-off-by: Marcel Klehr --- lib/private/TaskProcessing/Manager.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index 5e58fe180939c..385519c5a4bf1 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -320,6 +320,16 @@ public function process(?string $userId, array $input, callable $reportProgress) } catch (\OCP\Files\NotFoundException) { $folder = $this->appData->newFolder('text2image'); } + if ($input['numberOfImages'] > 12) { + throw new ProcessingException( + 'numberOfImages cannot be greater than 12' + ); + } + if ($input['numberOfImages'] < 1) { + throw new ProcessingException( + 'numberOfImages must be greater than 0' + ); + } $resources = []; $files = []; for ($i = 0; $i < $input['numberOfImages']; $i++) {