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

Migrate to PHP bindings of libvips for faster image preview generation #50146

Closed
ChapterSevenSeeds opened this issue Jan 11, 2025 · 3 comments
Closed
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: previews and thumbnails

Comments

@ChapterSevenSeeds
Copy link

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.
I recently installed the Memories app along with the Preview Generation app. As per the Preview Generation app's instructions, I began running the preview:generate-all command, and I've noticed that preview generation can take up to 4 seconds for some of my larger photos. This becomes an issue when I'm trying to pre-generate previews for tens of thousands of images.

Describe the solution you'd like
Upon setting the NextCloud development environment from the instructions here and stepping through some code, it looks like the internals of image manipulation for preview generation is done with GD. Would it be possible to migrate the usage of GD to libvips via php-vips or some other FFI/external tool? I did try to play with this idea in my development environment. However, since I am completely inexperienced in the PHP world, I was unsuccessful in getting the PHP installation to be happy with enabling FFI in my development environment. As such, I do not know the feasibility of such a migration or the performance/security implications.

Describe alternatives you've considered
I imagine there has been talk of using ImageMagick as the drop-in replacement for GD. Or, perhaps there exist applications (or support for applications) that can customize the default preview provider for various image types?

Additional context
If someone were able to point me in the right direction in getting FFI support enabled for PHP in a docker container, I would be happy to set up the development environment once again and give it another go. Otherwise, if anyone has any insight into this, such insight would be much appreciated.

@ChapterSevenSeeds ChapterSevenSeeds added 0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement labels Jan 11, 2025
@ChapterSevenSeeds ChapterSevenSeeds changed the title Migrate to PHP bindings of libvips for faster preview generation Migrate to PHP bindings of libvips for faster image preview generation Jan 11, 2025
@joshtrichards
Copy link
Member

joshtrichards commented Jan 11, 2025

Hi @ChapterSevenSeeds -

We already support running an Imaginary micro-service / high performance backend. It's also supported by that dev image. :-)

https://juliusknorr.github.io/nextcloud-docker-dev/services/imaginary/

https://github.com/juliusknorr/nextcloud-docker-dev/blob/8fec8bfc808563ee28c069437c2156b6d91521cf/docker-compose.yml#L1006-L1012

Some installation methods (such as our AIO stack) support it out-of-the-box.

See Server Tuning: Previews in the Admin Manual.

@ChapterSevenSeeds
Copy link
Author

Oh cool! I'll give that a read and play with it on my local instance. Thanks!

@joshtrichards
Copy link
Member

Closing since nothing actionable remains here. Don't hesitate to reach out on the help forum (https://help.nextcloud.com) if you run into trouble/etc.

@joshtrichards joshtrichards closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: previews and thumbnails
Projects
None yet
Development

No branches or pull requests

2 participants