diff options
author | Daniel Hansson <mailto@danielhansson.nu> | 2023-09-30 20:08:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-30 20:08:35 +0200 |
commit | b2d105e7ec44ec5a1a53a7a6140f1dfc0a9b2559 (patch) | |
tree | 0260e68885d6160d9eb5c555f16ef7a7c17101f1 /lib/private/Preview | |
parent | d215d8091699b39763c6c5d23b5125b7734c19f7 (diff) | |
download | nextcloud-server-b2d105e7ec44ec5a1a53a7a6140f1dfc0a9b2559.tar.gz nextcloud-server-b2d105e7ec44ec5a1a53a7a6140f1dfc0a9b2559.zip |
Generate all preview sizes for Imaginary
A follow up on https://github.com/nextcloud/server/pull/40670
Based on discussions here: https://github.com/nextcloud/server/issues/38911#issuecomment-1741819188
This fixes the case were not all previews are generated, for example in the activity view: https://github.com/nextcloud/server/issues/38911#issuecomment-1738886106
Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
Diffstat (limited to 'lib/private/Preview')
-rw-r--r-- | lib/private/Preview/Generator.php | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php index b9ea5ea1a07..9d93a6b3af7 100644 --- a/lib/private/Preview/Generator.php +++ b/lib/private/Preview/Generator.php @@ -139,23 +139,6 @@ class Generator { $previewVersion = $file->getPreviewVersion() . '-'; } - // If imaginary is enabled, and we request a small thumbnail, - // let's not generate the max preview for performance reasons - if (count($specifications) === 1 - && ($specifications[0]['width'] <= 256 || $specifications[0]['height'] <= 256) - && preg_match(Imaginary::supportedMimeTypes(), $mimeType) - && $this->config->getSystemValueString('preview_imaginary_url', 'invalid') !== 'invalid') { - $crop = $specifications[0]['crop'] ?? false; - $preview = $this->getSmallImagePreview($previewFolder, $previewFiles, $file, $mimeType, $previewVersion, $crop); - - if ($preview->getSize() === 0) { - $preview->delete(); - throw new NotFoundException('Cached preview size 0, invalid!'); - } - - return $preview; - } - // Get the max preview and infer the max preview sizes from that $maxPreview = $this->getMaxPreview($previewFolder, $previewFiles, $file, $mimeType, $previewVersion); $maxPreviewImage = null; // only load the image when we need it |