Generating one thumbnail preview per image and nothing more

I’m setting up Nextcloud as my private Google Photos replacement. I am still researching the compression algorithm to use (though I don’t have the horsepower needed for Google’s Guetzli), but my current issue stands with Nextcloud’s preview generation, and lack of documentation.

As I understand from this single online article I’ve been able to find that attempts to describe some of the Preview Generator’s options, previews of several dimensions are generated:

  • 32x32 images are supposedly thumbnails for the Files app in “List view”;
  • 256×256 images get generated three times, to my understanding: First, as thumbnails for the Files app in “Grid view”, and then twice for the Gallery app, once as regular thumbnails and once as folder thumbnails;
  • preview_max, which is actually the image that gets displayed when a user opens an image, instead of the original file. By default, this can be up to 16MP!

I would like to save space and computing power by reducing the number of previews that get generated. I am okay with 32x32 thumbs, but I would not like 3 different thumbnails generated for images in the 256×256 size – where and how can I force the Preview Generator to only create one image that both the Files and Gallery app can use?

Lastly, my biggest complaint is with the preview_max (or max preview) image. It takes up considerable disk space and processing power to generate them, but is ultimately useless to me as an end user – If my images are compressed and optimized for size already, why can’t the server show me the original (optimized) photo instead of bogging down the server to generate an image which is of lower quality? (In Google Photos, the image that gets displayed in full screen is the largest resolution image available – No need to download the image to get the full resolution pic.)

Hi, please read Understanding and improving Nextcloud Previews – Own your bits for understanding previews better.

This is the article I referenced and linked in my opening post. The author aims primarily to improve preview generation for SBCs, with understanding (i.e. documenting) the feature taking a back seat. The questions I asked stem from this article, but I cannot find an answer, neither on that website nor in any Nextcloud document.

Sry, I didn’t read your post completely.
In my opninion does the article already explain a lot of thinks.

This isn’t possible, afaik.

The max preview gets shown when you are viewing the file on any device. It makes sense to use this because your photos will load much quicker than if it would need to load the complete raw file and e.g. you don’t loose as much data volume if you are on a metered network. There is currently no way to force showing the original file except if you are willing to disable previews completely because all previews that are getting generated use this max preview file as a base for other preview formats that get generated, afaik. So the best solution for you would be to use the settings that are recommended in the articlet that I’ve linked because it only generates needed preview files and in an acceptable size/quality.

Actually, there is a way to not use the previewgenerator app. My server where Nextcloud is running on is so powerfull that it is able to create the previews on the fly while using the settings that are recommended in the article that I’ve linked above so that I don’t need to generate them using the previewgenerator app, hence I am saving a lot of disk space and the time where it would need to go through all of my files and generate previews for them.

I don’t think I can agree with this assessment. The author admits he does not know what all previews get generated, why they get generated 3 times for just the 256x256 size (let alone all the others), and where they are all used. He simply disables those previews which he deems unnecessary.
I deem the max-preview previews unnecessary, and would like to disable them. But as far as I understand max-preview is always generated so long as the Preview Generator is enabled (even if all other sizes of previews – i.e. thumbnails – are disabled).

It makes absolutely no sense to me. Again, my images are cropped and compressed, they are optimized for archiving and do not take up much space. Most are <1MB in size. I would like the user to see the images they uploaded, not some crappy preview with an arbitrarily chosen size (either 4096 or 2048), and an arbitrarily chosen JPEG quality (60 is too bad for most photos, anything else takes up more disk space than my original <1MB files).

I have tried adding 'enable_previews' => false, to config.php, and deleted the previews from the Nextcloud data directory. But now images are not displayed in a grid, nor in a list (because there are no thumbnail previews, i.e. 32x32 or 256x256), but they do load up quickly when I click on them. Also, on the mobile app (iOS and Android), images are not displayed at all, even after tapping on the image, and neither are the thumbnails.

Disabling previews is not an option because I want thumbnails, but it is unacceptable that the photo that opens is a ‘max-preview’ instead of the original image. At least give us the option!

I wonder if there is a way to generate the max_preview manually, or somehow symlink the max_preview file to the source file.

As I said, this is the reason why it is currently not possible to disable the max previews.

If they must be generated (a necessary evil, if you will), why is there no option to delete them once all previews are generated? Or, better yet, why can’t the thumbnail generation take the original file as their input? It shouldn’t be that hard to implement a switch, or am I underestimating the scale at which this app is hardcoded into the server codebase?

Since all previews are generated like this, it is most likely a very hard and time consuming task to rewrite this part of the code. This is probably the reason why this option wasn’t implemented, yet.

Either way, as I said above, you have currently the option to either disable previews completely or live with it.

BTW: I’ve found this statement: Show full size image in picture viewer instead of resized preview. Is it possible? · Issue #1968 · nextcloud/server · GitHub

For what it’s worth, I’ve also found Allow loading larger preview or full-sized images in image viewer #578 under nextcloud/viewer. The bug report/feature request is closed despite there being no real answer to why this behavior is implemented, or why an alternative is not an option. I am hoping for an implementation soon(ish), because as-is, Nextcloud, despite its fame online, is nowhere near a Google Photos alternative.

As long as the Nextcloud staff doesn’t triage this feature request as important, it will most likely not get implemented anytime soon.

But since this is Open Source Software, you are free to code it yourself or hire a freelancer that implements this feature for you.
Another option is to get a Nextcloud Subscription.

Another option:

Opening a new Issue, tell the situation, cheer user to thumbs up and wait to become this request relevant.

PreviewPhotos is an important app, but sadly have few official documentation and supporters.

As a matter of interest, what specs would the server have to be to implement that solution?