Skip to content

Commit f967134

Browse files
authored
Merge pull request #56928 from nextcloud/fix/taskprocessing-ocr
fix(TaskProcessing): Adjust OCR task type to allow for multiple files and pdfs
2 parents 71c2e94 + 25044f8 commit f967134

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/private/TaskProcessing/Manager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ private function _getTaskTypes(): array {
611611
\OCP\TaskProcessing\TaskTypes\AudioToAudioChat::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\AudioToAudioChat::class),
612612
\OCP\TaskProcessing\TaskTypes\ContextAgentAudioInteraction::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\ContextAgentAudioInteraction::class),
613613
\OCP\TaskProcessing\TaskTypes\AnalyzeImages::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\AnalyzeImages::class),
614+
\OCP\TaskProcessing\TaskTypes\ImageToTextOpticalCharacterRecognition::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\ImageToTextOpticalCharacterRecognition::class),
614615
];
615616

616617
foreach ($context->getTaskProcessingTaskTypes() as $providerServiceRegistration) {

lib/public/TaskProcessing/TaskTypes/ImageToTextOpticalCharacterRecognition.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function getName(): string {
4848
* @since 33.0.0
4949
*/
5050
public function getDescription(): string {
51-
return $this->l->t('Extract text from an image');
51+
return $this->l->t('Extract text from files like images or PDFs');
5252
}
5353

5454
/**
@@ -65,9 +65,9 @@ public function getId(): string {
6565
public function getInputShape(): array {
6666
return [
6767
'input' => new ShapeDescriptor(
68-
$this->l->t('Input Image'),
69-
$this->l->t('The image to extract text from'),
70-
EShapeType::Image
68+
$this->l->t('Input files'),
69+
$this->l->t('The files to extract text from'),
70+
EShapeType::ListOfFiles
7171
),
7272
];
7373
}
@@ -79,9 +79,9 @@ public function getInputShape(): array {
7979
public function getOutputShape(): array {
8080
return [
8181
'output' => new ShapeDescriptor(
82-
$this->l->t('Output text'),
83-
$this->l->t('The text that was extracted from the image'),
84-
EShapeType::Text
82+
$this->l->t('Output texts'),
83+
$this->l->t('The texts that were extracted from the files'),
84+
EShapeType::ListOfTexts
8585
),
8686
];
8787
}

0 commit comments

Comments
 (0)