Skip to content

Set name extension to task processing file outputs - #450

Merged
marcelklehr merged 4 commits into
mainfrom
enh/noid/output-file-ext
Oct 27, 2026
Merged

marcelklehr merged 4 commits into
mainfrom
enh/noid/output-file-ext

Conversation

@julien-nc

Copy link
Copy Markdown
Member
  • Use the (relatively) new OCP\TaskProcessing\FileShaped class to return file outputs in some providers.
  • Add a basic image format detection helper

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: image_type_to_extension(getimagesizefromstring($data)[2], false) can return the extension as well, instead of doing it manually

}
}
$result['output'] = $output;
$result['output'] = new FileShaped(EShapeType::Audio, $output, 'mp3');

@marcelklehr marcelklehr Oct 27, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this guaranteed to be an mp3? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's enforced as a request param. But some services might ignore this param indeed. Want to implement a type check?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good i think, in case the service doesn't follow the param

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@julien-nc
julien-nc force-pushed the enh/noid/output-file-ext branch from db6b630 to 8795ff7 Compare October 27, 2026 14:17
@marcelklehr
marcelklehr merged commit 65a2aad into main Oct 27, 2026
25 checks passed
@marcelklehr
marcelklehr deleted the enh/noid/output-file-ext branch October 27, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants