projects
/
GitHub
/
WoltLab
/
WCF.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c0079b
)
Skip thumbnails for non-image files
author
Alexander Ebert
<ebert@woltlab.com>
Mon, 15 Apr 2024 10:18:16 +0000
(12:18 +0200)
committer
Alexander Ebert
<ebert@woltlab.com>
Sat, 8 Jun 2024 10:19:38 +0000
(12:19 +0200)
wcfsetup/install/files/lib/data/file/thumbnail/FileThumbnailEditor.class.php
patch
|
blob
|
blame
|
history
wcfsetup/install/files/lib/system/file/processor/FileProcessor.class.php
patch
|
blob
|
blame
|
history
diff --git
a/wcfsetup/install/files/lib/data/file/thumbnail/FileThumbnailEditor.class.php
b/wcfsetup/install/files/lib/data/file/thumbnail/FileThumbnailEditor.class.php
index 05118c1b63303bfb76465ee5669af8847db66b21..2f34c47bc2d7c86c103f5db0553bb89538da5a0b 100644
(file)
--- a/
wcfsetup/install/files/lib/data/file/thumbnail/FileThumbnailEditor.class.php
+++ b/
wcfsetup/install/files/lib/data/file/thumbnail/FileThumbnailEditor.class.php
@@
-35,7
+35,7
@@
class FileThumbnailEditor extends DatabaseObjectEditor
'data' => [
'fileID' => $file->fileID,
'identifier' => $format->identifier,
- 'fileHash' => hash_file('sha256', $filename),
+ 'fileHash' =>
\
hash_file('sha256', $filename),
'fileExtension' => 'webp',
'width' => $width,
'height' => $height,
diff --git
a/wcfsetup/install/files/lib/system/file/processor/FileProcessor.class.php
b/wcfsetup/install/files/lib/system/file/processor/FileProcessor.class.php
index f0ab87ecfe9dc4bc6ff21b76223bef9393f91921..fe6639b445770d5b58067c0c1eb0daf2987a5d14 100644
(file)
--- a/
wcfsetup/install/files/lib/system/file/processor/FileProcessor.class.php
+++ b/
wcfsetup/install/files/lib/system/file/processor/FileProcessor.class.php
@@
-72,6
+72,10
@@
final class FileProcessor extends SingletonFactory
public function generateThumbnails(File $file): void
{
+ if (!$file->isImage()) {
+ return;
+ }
+
$processor = $file->getProcessor();
if ($processor === null) {
return;