Specify correct size preview for file listing for images (32x32)?

Hi Everyone.

I’m running Nextcloud 18 on Ubuntu 18.04 on Apache 2.4 and MySQL on AWS EC2.

I’m trying to use previewgenerator to pre-generate the image previews. My users will only use the preview in max preview or the small 32x32 preview in the detailed file listing.

So I set the preview generator to generator 32x32 and 256x256 crop square sizes and the max preview x size of 2560 and y size of 1440.

But it seems like the file listing does not use 32x32 or 256x256 generated at all. It will generate on the fly for these crop sizes sometimes as large as 1020x1020… and this will lock up the system if I browse onto a folder with few hundred high resolution images.

Is there a way to specify what size file detail listing preview size should be?
It is loading a fairly large image in a 32x32 sized area on the browser.

Or maybe there’s an error in my config?
My config:
‘enable_previews’ => true,
‘preview_max_x’ => 2560,
‘preview_max_y’ => 1440,
‘preview_max_scale_factor’ => 1,
‘filelocking.enabled’ => true,
‘jpeg_quality’ => ‘60’,
config:app:set --value=“256” previewgenerator squareSizes

Thank you!
Jack

This is the 32x32 file detailed listing view that I am asking about:

Even though the area is only 32x32, if I use browser to check what image size were used… it could go up to as large as 1024x1024 (or even large in that small 32x32 area).

The preview system automatically generates several copies of an image in different sizes and selects the one which best fits for the requested action. Please check-out the description of the Preview generator app to get an idea what files are generated and how you can influence the behavior.

Hi j-ed!

Thank you for the reply.
I did read up on the preview generator app.
And I was hoping that by running “preview:generate-all” that I would generate these preview sizes first before users hit those pages.

However, I can’t seem to determine what image sizes the file listing detail view will use.
Doing more testing in the last few hours. Here’s what I also found.

Original Image size: 6385 x 4261
Crop preview size: 1024 x 1024
(seems to want to use this size for horizontal oriented images)

Original Image size: 3840 x 5760
Crop size: 960 x 960
(seems to want to use this size for vertical oriented images)

For original images below 1024 in either x or y, then it picks the lowest for crop square images.
(So for 540 x 720, then it generates 540 x 540 for crop square)

That’s how it works.

You can find all preview images in the [nc-data-folder]/appdata_xyz/preview. As I wrote it automatically selects the one which best fits for the requested purpose. As described in the preview generator app description, you can limit the number of images being created. Additionally you can set a maximum size of previews in the Nextcloud configuration itself.

Thanks for replying j-ed.

Yes. I have been monitoring the preview folder.

If the crop preview size isn’t predictable (since system selects a size that best fit), then there isn’t a point to pre-generate the crop sizes?

As described in the description of the preview generator app, you can limit which sizes should be generated by setting individual parameters. The activate settings can easily be checked by executing the following commands:

./occ config:app:get previewgenerator squareSizes
./occ config:app:get previewgenerator widthSizes
./occ config:app:get previewgenerator heightSizes

Hi j-ed,

Yes. I did those settings to pre-generate and limit what sizes (esp. the squresizes).
So, as I have described in my initial post, I limited the squaresize to just “256”.

But I have found afterwards, it doesn’t matter what I limit or pre-generate. The file listing viewer would generate the size that it sees best fit (per your reply).

Hence, there’s no point to pre-generate the squaresizes.