All Projects → nextcloud → previewgenerator

nextcloud / previewgenerator

Licence: AGPL-3.0 license
Nextcloud app to do preview generation in the background.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to previewgenerator

Cookbook
🍲 A library for all your recipes
Stars: ✭ 195 (-45.07%)
Mutual labels:  nextcloud
firstrunwizard
🔮 The first impression matters. The firstrunwizard is the first Nextcloud impression.
Stars: ✭ 34 (-90.42%)
Mutual labels:  nextcloud
weather
⛅️ Weather app for Nextcloud
Stars: ✭ 41 (-88.45%)
Mutual labels:  nextcloud
Nextcloud Spreed Signaling
Standalone signaling server for Nextcloud Talk.
Stars: ✭ 201 (-43.38%)
Mutual labels:  nextcloud
Baiyue onekey
佰阅部落一键脚本合集工具箱,集合25+优质开源项目,一步到位,全程中文交互提示,不懂代码也可以轻松搭建很多程序
Stars: ✭ 246 (-30.7%)
Mutual labels:  nextcloud
nextcloud announcements
ℹ️ The latest Nextcloud news directly in your notifications
Stars: ✭ 16 (-95.49%)
Mutual labels:  nextcloud
Docker Onlyoffice Nextcloud
Stars: ✭ 190 (-46.48%)
Mutual labels:  nextcloud
files videoplayer
📼 Old video viewer for Nextcloud
Stars: ✭ 92 (-74.08%)
Mutual labels:  nextcloud
Maps
🌍🌏🌎 The whole world fits inside your cloud!
Stars: ✭ 253 (-28.73%)
Mutual labels:  nextcloud
Android-SingleSignOn
Single sign-on for Nextcloud (Android Library Project)
Stars: ✭ 62 (-82.54%)
Mutual labels:  nextcloud
Android
📱 Nextcloud Android app
Stars: ✭ 2,669 (+651.83%)
Mutual labels:  nextcloud
Facerecognition
Nextcloud app that implement a basic facial recognition system.
Stars: ✭ 226 (-36.34%)
Mutual labels:  nextcloud
viewer
🖼 Simple file viewer with slideshow for media
Stars: ✭ 68 (-80.85%)
Mutual labels:  nextcloud
Client theming
💻 Nextcloud themed desktop client - Moved over to https://github.com/nextcloud/desktop
Stars: ✭ 201 (-43.38%)
Mutual labels:  nextcloud
nextcloud-docker
☁️ NextCloud with SSL and Docker
Stars: ✭ 30 (-91.55%)
Mutual labels:  nextcloud
Richdocuments
📔 Collabora Online for Nextcloud
Stars: ✭ 193 (-45.63%)
Mutual labels:  nextcloud
docker-nextcloud
Nextcloud Docker image
Stars: ✭ 209 (-41.13%)
Mutual labels:  nextcloud
nextcloud docker
Docker setup to run Nextcloud
Stars: ✭ 35 (-90.14%)
Mutual labels:  nextcloud
promo
🎉 Stickers, shirts, presentations etc!
Stars: ✭ 16 (-95.49%)
Mutual labels:  nextcloud
aws-serverless-nextcloud
moved - https://github.com/f7o/aws-serverless-nextcloud
Stars: ✭ 78 (-78.03%)
Mutual labels:  nextcloud

Preview Generator

Nextcloud app that allows admins to pre-generate previews. The app listens to edit events and stores this information. Once a cron job is triggered it will start preview generation. This means that you can better utilize your system by pre-generating previews when your system is normally idle and thus putting less load on your machine when the requests are actually served.

The app does not replace on demand preview generation so if a preview is requested before it is pre-generated it will still be shown.

How to install

  • Install directly from within your Nextcloud from the app store
  • Clone this repository into your Nextcloud app folder

How to use the app

  1. Install the app
  2. Enable the app
  3. Run ./occ preview:generate-all once after installation.
  4. Add a (system) cron job for ./occ preview:pre-generate
  • I run it every 10 minutes

Known issues

  • The app does not work with encryption enabled

How does the app work

  1. Listen to events that a file has been written or modified and store it in the database
  2. On cron run request previews for the files that have been written or modified

If a preview already exists at step 2 then requesting it is really cheap. If not it will be generated. Depending on the sizes of the files and the hardware you are running on the time this takes can vary.

Commands

preview:generate-all [--path=PATH ...] [user_id ...]

Loop over all files and try to generate previews for them. If one or multiple user ids are supplied it will just loop over the files of those users. You can also limit the generation to one or more paths using --path="/[username]/files/[folder path]", e.g. --path="/alice/files/Photos". Note that all given user_ids are ignored if at least one path is specified.

preview:pre-generate

Do the actual pregeneration. This means only for new or modified files (since the app was enabled or the last pregeneration was done).

FAQ

Why can't I use webcron?

Preview generation can be a very long running job. Thus we need a system that does not time out.

I get "Command already running"

Yes this happens when the pre-generate command crashes. No worries the lock will be released after 30 minutes of inactivity from the app. So go grab a cookie.

I don't want to generate all the preview sizes

This is possible since version 1.0.8. Just set the correct values via the command line

./occ config:app:set --value="32 64 1024"  previewgenerator squareSizes
./occ config:app:set --value="64 128 1024" previewgenerator widthSizes
./occ config:app:set --value="64 256 1024" previewgenerator heightSizes

This will only generate:

  • square previews of: 32x32, 64x64 and 1024x1024
  • aspect ratio previews with a width of: 64, 128 and 1024
  • aspect ratio previews with a height of: 64, 256 and 1024

Note:

  • preview sizes are always a power of 2.
  • The smallest size is 32
  • The max size is determined by your preview settings in config.php

I get "PHP Fatal error: Allowed memory size of X bytes exhausted"

You need to increase the memory allowance of PHP, by default it is 128 MB. You do that by changing the memory_limit in the php.ini file.

If you use the docker container you need set the environment variable PHP_MEMORY_LIMIT instead.

I want to skip a folder and everything in/under it

Add an empty file with the name .nomedia in the folder you wish to skip. All files and subfolders of the folder containing .nomedia will also be skipped.

I want to reset/regenerate all previews

WARNING: This is not supported but it has been confirmed to work by multiple users. Proceed at your own risk. Always keep backups around.

  1. Remove the folder your-nextcloud-data-directory/appdata_*/preview
  2. Optional: change parameters preview_max_x and preview_max_y in config.php (e.g., to 512), and change the previewgenerator app parameters heightSizes, squareSizes and widthSizes as per the README (or better yet, to a low value each, e.g. 512, 256 and 512 respectively)
  3. Run occ files:scan-app-data (this will reset generated previews in the database)
  4. Run occ preview:generate-all [user-id] (this will run very fast if you did step 2)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].