nextcloud / previewgenerator

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

Generate WEBP previews for WEBP files (or at least as JPG) #314

Closed VeederLicht closed 1 year ago

VeederLicht commented 1 year ago

I cant believe i'm having to create an issue for this in 2022, but here we go:

Also see https://github.com/nextcloud/viewer/issues/1315

Currently for WEBP files, the viewer generates PNG files (who thought that was a good idea?). Resulting in 3~4 MB PNG files where the WEBP original files are a few 100 KB. This is obviously not desired, to put it mildly. I have folders filled with WEBP files, resulting in a '90's style excruciating slow browsing experience because of this.

Desired behaviour: Fully support WEBP formats by creating previews of the same format.

Info: WEBP and WEBM formats were specifically introduced over a decade ago to replace archaic formats like PNG, BMP, JPG, AVI and MPEG.

st3iny commented 1 year ago

The previews themselves are generated by the server. Unfortunately, I have no influence over the logic itself. My app just triggers the generation process.

Please have a look at https://github.com/nextcloud/server/issues/13552 for the feature request.

VeederLicht commented 1 year ago

Are you kidding me? Even if generating WEBP previews is not supported by the software you are using, then at least disable preview generation for that format and serve the raw WEBP files. The current 'solution' serves 'preivew' PNG files that are 6-10x the size of the original, i cant believe how stupendous this is!

st3iny commented 1 year ago

I totally agree, that the preview generation is suboptimal in some cases. In the end this is a matter of priorities. Please remember that you can't expect us to implement features for free.

Contributions in this area are always welcome. Feel free to open a PR if you are experienced in this area.

VeederLicht commented 1 year ago

Sure. Is that preview-generating library also opensource? If so, can you link to it?

VeederLicht commented 1 year ago

I mean, the PreviewGenerator method implements the IPreview interface, but the actual implementation seems to be passed as a parameter. Which function is responsible for calling this class and passing the actual implementation? I will find my way from there.

st3iny commented 1 year ago

Take a look at:

The class \OC\Preview\Generator is located in https://github.com/nextcloud/server/blob/048fdabca905746c542cabefc5c0b4684819fdf3/lib/private/Preview/Generator.php.