Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nextcloud): add support of imaginary an externalPreviewProvider #622

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

wrenix
Copy link
Collaborator

@wrenix wrenix commented Aug 17, 2024

Description of the change

Benefits

  • faster image rendering for preview
  • nextcloud container is not killed (e.g. OOM) if big and much preview images are generated

Possible drawbacks

Works for me.

TODO:

  • write CI test

Checklist

@wrenix wrenix force-pushed the feat/imaginary branch 5 times, most recently from 6ace176 to 44beda3 Compare August 17, 2024 01:32
@wrenix wrenix marked this pull request as ready for review August 17, 2024 01:48
@wrenix wrenix force-pushed the feat/imaginary branch 2 times, most recently from 04d871c to 5b0fc90 Compare September 6, 2024 07:29
@wrenix
Copy link
Collaborator Author

wrenix commented Sep 11, 2024

ping @jessebot / @provokateurin do you like to review?

@provokateurin
Copy link
Member

Sorry, I don't have the time for that atm. I hope I can do it at some point, but only at the beginning of next month the earliest.

@jessebot
Copy link
Collaborator

jessebot commented Sep 20, 2024

oh this is neat! May I ask what the difference between this and the preview generator app are? (I'm not against it btw, just want to learn more) I will review this more thoroughly as soon as I have a moment 🙏

Copy link
Collaborator

@jessebot jessebot left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for this! Perhaps we can add another PR for adding a CI test of some sort in the future?

@SIMULATAN
Copy link

Thank you for working on this 🚀
Just wanted to point out that, with Nextcloud 30, the OC\Preview\Imaginary provider no longer generates PDF previews. It may be worth considering adding the new ImaginaryPDF provider to the Imaginary notes in the README.md file.
See https://docs.nextcloud.com/server/latest/admin_manual/release_notes/upgrade_to_30.html#previews-for-pdf-files-with-imaginary
Thanks again, looking forward to using it to speed up my (terribly slow) Nextcloud media previewing ❤️

@wrenix
Copy link
Collaborator Author

wrenix commented Sep 28, 2024

rebased on main and add docu in e393d90 like @SIMULATAN suggested

@wrenix
Copy link
Collaborator Author

wrenix commented Oct 11, 2024

rebased, squashed und test added

@wrenix
Copy link
Collaborator Author

wrenix commented Oct 22, 2024

rebased - Does i interprate you @jessebot last comment correct, that i could merge it?

Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

LGTM, just one question

Comment on lines 496 to 531
'enabledPreviewProviders' => array(
0 => 'OC\\Preview\\Imaginary',
1 => 'OC\\Preview\\ImaginaryPDF',
Copy link
Member

Choose a reason for hiding this comment

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

Given that this is required for imaginary to be utilized, should it just be part of the defaultConfig?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am not sure which other PreviewProvider are default.
And which we should enable after enable Imaginary (like for office/collabora and txt files).

Copy link
Member

Choose a reason for hiding this comment

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

I don't remember if the config values with arrays are merged or overwritten, but if they are just merged then there is no problem with adding these. Maybe you can check how that works and based on that we enable them by default or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed in f910cc6

@provokateurin
Copy link
Member

It would be nice to add a test that generating the preview works (similar to how we test S3 in the job).

@wrenix
Copy link
Collaborator Author

wrenix commented Oct 23, 2024

Yes, it would be nice - i do not know when a preview generation is triggered (i believe in viewing)

@provokateurin
Copy link
Member

You can request a preview via https://github.com/nextcloud/server/blob/b5ac989ecd4e6f380af4699cb8c0aae872284459/core/openapi.json#L8178

@wrenix wrenix force-pushed the feat/imaginary branch 11 times, most recently from df7cedf to d61c3e1 Compare November 5, 2024 00:43
@wrenix wrenix force-pushed the feat/imaginary branch 3 times, most recently from 1d58fc3 to fb41953 Compare November 12, 2024 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants