From 0b0ea3d8d9b9576c0a6615aa8c6e6503eca6f818 Mon Sep 17 00:00:00 2001 From: Jonas Meurer Date: Wed, 2 Feb 2022 11:57:17 +0100 Subject: [PATCH] Fix preview generation for office documents `new \imagick` returns an object, but we need the image blob (binary string) from this object. This is a partial backport of #26531, which brings a lot of refactoring but also contains the fix. Fixes: #29956 Signed-off-by: Jonas Meurer --- lib/private/Preview/Office.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Preview/Office.php b/lib/private/Preview/Office.php index fef218823e21d..50c016737ece9 100644 --- a/lib/private/Preview/Office.php +++ b/lib/private/Preview/Office.php @@ -74,7 +74,7 @@ public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { } $image = new \OC_Image(); - $image->loadFromData($png); + $image->loadFromData((string) $png); $this->cleanTmpFiles(); unlink($pngPreview);