nextcloud / previewgenerator

Nextcloud app to do preview generation in the background.
https://apps.nextcloud.com/apps/previewgenerator
GNU Affero General Public License v3.0
455 stars 57 forks source link

Does previewgenerator uses Imaginary ? #312

Closed Pix13 closed 2 years ago

Pix13 commented 2 years ago

I'm about to use it, but i'd like to know if it will use Imaginary micro service if my instance already uses it ?

st3iny commented 2 years ago

I never heard of Imaginary so I guess it doesn't support it. We mostly use gd, imagick and ffmpeg to generate thumbnails. Could you please elaborate?

Pix13 commented 2 years ago

I was wondering if preview generator uses the \OC\Preview providers, if so when using Imaginary ( see end of https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html ) it would use it "transparently", offloading the whole previews on the microservice too

st3iny commented 2 years ago

Yes, that is exactly how the app works. It uses the providers from your server and it should work with Imaginary if you configured it properly.

I hope this answers your question.

Pix13 commented 2 years ago

Yes thank you, i have a small CPU on my instance ( an aarch64 ) and offloaded the preview, and i wasn "afraid" pre-genereting them could load the server too much :) Thank you!

Pix13 commented 2 years ago

Addenda: i can confirm it works, and really well, around 10% cpu used by php occ:generate-all, 100Mb/s of pictures being reduced over the network by my imaginary instance :) great combo!

Cebrain commented 1 year ago

Hey @Pix13 i checked imaginary and i also would like to use it. Could you provide the information how to start the docker that it works fine with nextcloud? I checked the documentation and there is so much, i dont know exactly where to start.

cburlacu commented 1 year ago

... It uses the providers from your server and it should work with Imaginary if you configured it properly. Hi @st3iny , What does properly mean? I followed the steps from server_tuning.html#previews, imaginary docker seems to work (curl -O "<preview_imaginary_url>/crop?width=500&height=400&url=https://raw.githubusercontent.com/h2non/imaginary/master/testdata/large.jpg" but occ preview:generate-all doesn't uses it.. Thank you!

LE: After adding

  'preview_concurrency_all' => 8,
  'preview_concurrency_new' => 8,
  'preview_max_x' => 256,
  'preview_max_y' => 256,

it seems to work, not sure what are the minimum settings to make it work...