Skip to content

Commit b2d105e

Browse files
authored
Generate all preview sizes for Imaginary
A follow up on #40670 Based on discussions here: #38911 (comment) This fixes the case were not all previews are generated, for example in the activity view: #38911 (comment) Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
1 parent d215d80 commit b2d105e

1 file changed

Lines changed: 0 additions & 17 deletions

File tree

lib/private/Preview/Generator.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -139,23 +139,6 @@ public function generatePreviews(File $file, array $specifications, $mimeType =
139139
$previewVersion = $file->getPreviewVersion() . '-';
140140
}
141141

142-
// If imaginary is enabled, and we request a small thumbnail,
143-
// let's not generate the max preview for performance reasons
144-
if (count($specifications) === 1
145-
&& ($specifications[0]['width'] <= 256 || $specifications[0]['height'] <= 256)
146-
&& preg_match(Imaginary::supportedMimeTypes(), $mimeType)
147-
&& $this->config->getSystemValueString('preview_imaginary_url', 'invalid') !== 'invalid') {
148-
$crop = $specifications[0]['crop'] ?? false;
149-
$preview = $this->getSmallImagePreview($previewFolder, $previewFiles, $file, $mimeType, $previewVersion, $crop);
150-
151-
if ($preview->getSize() === 0) {
152-
$preview->delete();
153-
throw new NotFoundException('Cached preview size 0, invalid!');
154-
}
155-
156-
return $preview;
157-
}
158-
159142
// Get the max preview and infer the max preview sizes from that
160143
$maxPreview = $this->getMaxPreview($previewFolder, $previewFiles, $file, $mimeType, $previewVersion);
161144
$maxPreviewImage = null; // only load the image when we need it

0 commit comments

Comments
 (0)