aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2025-05-27 11:23:28 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-05-27 12:56:19 +0000
commit7ac1adeccf40e5191c2c423ce094f6ae12a81ac3 (patch)
tree6b65049740823cdbfe4cfd280ccbd496de05a550
parente4261a6be11bff1e6a0364841ffc111e997aa71e (diff)
downloadnextcloud-server-backport/53130/stable30.tar.gz
nextcloud-server-backport/53130/stable30.zip
fix(blurhash): Skip generation the if previews are disabled.backport/53130/stable30
Signed-off-by: Louis Chemineau <louis@chmn.me>
-rw-r--r--lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php b/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php
index 982693bcfe8..8faf4627251 100644
--- a/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php
+++ b/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php
@@ -68,6 +68,11 @@ class GenerateBlurhashMetadata implements IEventListener {
return;
}
+ // Preview are disabled, so we skip generating the blurhash.
+ if (!$this->preview->isAvailable($file)) {
+ return;
+ }
+
$preview = $this->preview->getPreview($file, 64, 64, cacheResult: false);
$image = @imagecreatefromstring($preview->getContent());