nextcloud / previewgenerator

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

Preview size question #372

Closed MaxXor closed 1 year ago

MaxXor commented 1 year ago

Hey, thanks for this amazing plugin. I've been using it to generate previews of size 1440x810 from original resolution 4000x2250. I use the previews mostly in the photos app for the albums, Nextcloud gladly uses the highest resolution preview generated by this plugin (when you click on a image to enlarge it, it shows the highest resolution preview). However 1440 is not a power of 4 anymore... I don't really understand the reason behind that change... The next closest one is 1024x576 which is a lot smaller and doesn't look that good in the photos app anymore. Is there any way to generate previews with size 1440 or is it gone?

My config looked like this for all 3 options: "64 512 1024 1440". Using Nextcloud 26.0.

st3iny commented 1 year ago

It is still possible to request custom sizes via the app config options.

Unfortunately, all preview sizes are increased to the next power of 4. I'm not entirely sure how the photo app works but I think that there is no way around it.

You could take the next power of 4 (4096) or try to limit the preview_max_* configs. Be warned that I didn't test this (not with values that aren't powers of 2 or 4). Ref https://github.com/nextcloud/server/blob/0c86714144f50a66e845e9ef80d4cd7e6918a4f5/lib/private/Preview/Generator.php#L340-L341

Related to https://github.com/nextcloud/photos/issues/1492

MaxXor commented 1 year ago

That's interesting... using latest Nextcloud 26.0 and previewgenerator 5.2.2 I deleted my previews directory, kept my config to "64 512 1024 1440" and preview_max_* to 1440 and re-generated all previews. It still generates previews for 1440 but it's not a power of 4...? So it still works as expected. :smile: I was a little too hasty.

image

(Some directories in the previews folder also contain "1440-1440-max" or "1440-960-max", probably intended because of some different scaling?)